// JavaScript Document
/**
 * @author Yisin
 * @date 2011-11-08
 * @version 1.0
 * @scription 创建Yisin对象 参数说明： arg : (id,name,className,tagName) id : '#id' name :
 *            '@name' className : '.className' tagName : 'tagName'
 */
var user_browser = 'nonie';
var broweVersion = 0;
var System = 'windows';
if (document.addEventListener) {
	user_browser = 'nonie';
} else {
	user_browser = 'ie';
}
if(window.navigator.appName == "Microsoft Internet Explorer"){
	user_browser = 'ie';
}

/***** 全局变量定义 ******/
var ajax_spendTime = 0.0;
var fenye_type = 1;
var cover_mark = false;
var cover__width, cover__height, cover__left, cover__top;

/**
 * @returns ie:IE，ff:火狐，sf:苹果，gg:谷歌
 */
function CheckBrowser(){
    var app = navigator.userAgent;
    var verStr = navigator.appVersion;
    System = navigator.platform;
    if(navigator.userAgent.indexOf("MSIE")>0) {
    	user_browser = 'ie';
    	if (verStr.indexOf("MSIE 3.0") != -1 || verStr.indexOf("MSIE 4.0") != -1 || verStr.indexOf("MSIE 5.0") != -1 || verStr.indexOf("MSIE 5.1") != -1) {
        	broweVersion = 6.0;
        } else {
        	broweVersion = app.indexOf("MSIE 6.0") > 0 ? 6.0 : broweVersion;
        	broweVersion = app.indexOf("MSIE 7.0") > 0 ? 7.0 : broweVersion;
        	broweVersion = app.indexOf("MSIE 8.0") > 0 ? 8.0 : broweVersion;
        	broweVersion = app.indexOf("MSIE 9.0") > 0 ? 9.0 : broweVersion;
        }
    	return ["ie",broweVersion];  
	} 
    broweVersion = verStr;
	if(navigator.userAgent.indexOf("Firefox")>0){ 
		user_browser = 'ff';
		return ["ff",broweVersion];  
	}  
	if(navigator.userAgent.indexOf("Safari")>0) { 
		user_browser = 'sf';
		return ["sf",broweVersion];  
	}   
	if(navigator.userAgent.indexOf("Camino")>0){ 
		user_browser = 'co';
		return ["co",broweVersion];  
	}
	if(navigator.userAgent.indexOf("Chrome")>0){ 
		user_browser = 'gg';
		return ["gg",broweVersion];  
	} 
	
}


function J(arg) {
	return new Yisin(arg);
}

// 遮罩层对象
var yisin_blankScreen = null;
var yisin_headDiv = null;
/**
 * @author Yisin
 * @date 2011-11-08
 * @version 1.0
 * @scription Yisin对象 参数说明： arg : (id,name,className,tagName) id : '#id' name :
 *            '@name' className : '.className' tagName : 'tagName'
 */
function Yisin(arg) {
	this.argument = arg;
	this.speed = arguments[1];
	this.bool = arguments[2];
	if (this.speed == undefined || typeof (this.speed) != 'number') {
		this.speed = 5;
	}
	if (this.bool == undefined || typeof (this.bool) != 'boolean') {
		this.bool = false;
	}
	this.Y = function() {
		var pam = this.argument;
		if (pam != undefined && typeof (pam) == 'string') {
			if (pam.length > 1) {
				var firstChar = pam.substring(0, 1);
				var chars = pam.substring(1, pam.length);
				if (firstChar == '#') {
					return document.getElementById(chars);
				} else if (firstChar == '@') {
					return document.getElementsByName(chars);
				} else if (firstChar == '.') {
					return this.getElementsByClassName(chars);
				} else {
					return document.getElementsByTagName(pam);
				}
			} else {
				return undefined;
			}
		} else if (pam != undefined && typeof (pam) == 'object') {
			return this.argument;
		} else {
			return this.getDocumentObject();
		}
	};

	this.getElementsByClassName = function(className) {
		var all = document.all ? document.all : document
				.getElementsByTagName('*');
		var elements = new Array();
		for ( var i = 0; i < all.length; i++) {
			if (all[i].className == className) {
				elements[elements.length] = all[i];
			}
		}
		return elements;
	};
	/**
	 * 获取样式
	 */
	this.getStyle = function(elem, styles) {
		var value;
		if (typeof (elem) != 'object') {
			elem = Y("#" + elem);
		}
		if (styles == "float") {
			document.defaultView ? styles = 'float'/* cssFloat */
			: styles = 'styleFloat';
		}
		try {
			value = elem.style[styles] || elem.style[styles.camelize()];
		} catch (error) {
			alert('缺少[' + styles + ']样式！');
			return;
		}
		if (!value) {
			if (document.defaultView && document.defaultView.getComputedStyle) {
				var _css = document.defaultView.getComputedStyle(elem, null);
				value = _css ? _css.getPropertyValue(styles) : null;
			} else {
				if (elem.currentStyle) {
					value = elem.currentStyle[styles.camelize()];
				}
			}
		}
		if (value == "auto" && [ "width", "height" ].contains(styles)
				&& elem.style.display != "none") {
			value = elem["offset" + styles.capitalize()] + "px";
		}
		if (styles == "opacity") {
			try {
				value = elem.filters['DXImageTransform.Microsoft.Alpha'].opacity;
				value = value / 100;
			} catch (e) {
				try {
					value = elem.filters('alpha').opacity;
				} catch (err) {
				}
			}

		}
		return value == "auto" ? null : value;
	};
	/**
	 * @author Yisin
	 * @date 2011-10-26
	 * @param arg1
	 *            第一个参数（Event : Document 事件对象））
	 */
	this.getDocumentObject = function(e) {
		if (!e) {
			e = window.event;
		} else {
			e.srcElement = e.target;
		}
		return Y("#" + e.srcElement.id) || Y("@" + e.srcElement.name)[0]
				|| Y("." + e.srcElement.getAttribute("class"))
				|| Y(e.srcElement.tagName)[0];
	};
	// 页面加载完后绑定方法
	this.ready = function(fn) {
		if (document.addEventListener) {
			window.addEventListener("load", function() {
				fn.call(document, Yisin);
			}, false);
		} else {
			window.attachEvent("onload", function() {
				fn.call(document, Yisin);
			});
		}
	};
	/**
	 * @author Yisin
	 * @date 2011-11-08
	 * @version 1.0
	 * @scription 动画
	 * @param genre :
	 *            动画类型
	 * 
	 */
	this.cartoon = function() {
		var tempObj = this.Y();
		var DocumentObject = tempObj;
		if (tempObj != undefined && tempObj.length > 1) {
			DocumentObject = tempObj[0];
		}
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		var genre = arguments[0];
		if (genre != undefined) {
			if (genre == 'show' || genre == 'hidden') {// 消失-出现
				var speed = arguments[1];
				if (speed == undefined || typeof (speed) != 'number') {
					speed = this.speed;
				}
				this.show1(DocumentObject, genre, speed);
			} else if (genre == 'spread' || genre == 'shrink') {// 想外扩散-向内收拢
				var speed = arguments[1];
				var bool = arguments[2];
				if (speed == undefined || typeof (speed) != 'number') {
					speed = this.speed;
				}
				if (bool == undefined || typeof (bool) != 'boolean') {
					bool = this.bool;
				}
				this.show2(DocumentObject, genre, speed, bool);
			}
		}
	};
	/**
	 * @author Yisin
	 * @date 2011-10-26
	 * @version 1.0
	 * @param arg2第二个参数
	 *            动画类型
	 * @param arg3
	 *            第三个参数（speed ：动画速度 数值 默认 5毫秒）
	 */
	// show1 : function(arg1, arg2, arg3){
	this.show1 = function(DocumentObject, genre, speed) {
		// 对象显示动画
		var t_s_left = parseInt(DocumentObject.style.left) + 100;
		var t_s_top = parseInt(DocumentObject.style.top) + 100;
		var t_s_hnum = 0, t_s_hint = 0;
		function shows() {
			if (t_s_hnum < 96) {
				t_s_hint = t_s_hint + 1;
				t_s_hnum = t_s_hnum + speed;
				DocumentObject.style.left = (t_s_left - t_s_hint * speed)
						+ "px";
				DocumentObject.style.top = (t_s_top - t_s_hint * speed) + "px";
				if(user_browser == 'ie'){
					DocumentObject.style.filter = "alpha(opacity=" + t_s_hnum + ")";
				}
				DocumentObject.style.opacity = (t_s_hnum/100);
				DocumentObject.style.MozOpacity = (t_s_hnum/100);
				DocumentObject.style.display = "block";
				setTimeout(shows, 1);
			} else {
				DocumentObject.style.left = t_s_left - 100 + "px";
				DocumentObject.style.top = t_s_top - 100 + "px";
				if(user_browser == 'ie'){
					DocumentObject.style.filter = "alpha(opacity=100)";
				}
				DocumentObject.style.opacity = 1;
				DocumentObject.style.MozOpacity = 1;
			}
		}

		// 动画隐藏动画
		var t_h_left = parseInt(DocumentObject.style.left);
		var t_h_top = parseInt(DocumentObject.style.top);
		var t_h_hnum = 100, t_h_hint = 0;
		function hidde() {
			if (t_h_hnum > 4) {
				t_h_hint = t_h_hint + 1;
				t_h_hnum = t_h_hnum - 5;
				DocumentObject.style.left = (t_h_left + t_h_hint * speed)
						+ "px";
				DocumentObject.style.top = (t_h_top + t_h_hint * speed) + "px";
				if(user_browser == 'ie'){
					DocumentObject.style.filter = "alpha(opacity=" + t_h_hnum + ")";
				}
				DocumentObject.style.opacity = (t_h_hnum/100);
				DocumentObject.style.MozOpacity = (t_h_hnum/100);
				setTimeout(hidde, 1);
			} else {
				DocumentObject.style.left = t_h_left + "px";
				DocumentObject.style.top = t_h_top + "px";
				if(user_browser == 'ie'){
					DocumentObject.style.filter = "alpha(opacity=100)";
				}
				DocumentObject.style.opacity = 1;
				DocumentObject.style.MozOpacity = 1;
				DocumentObject.style.display = "none";
			}
		}

		if (genre == 'show') {
			shows();
		} else if (genre == 'hidden') {
			hidde();
		}
	};
	/**
	 * @author Yisin
	 * @date 2011-10-26
	 * @version 1.0
	 * @param arg1
	 *            第一个参数（speed ：动画速度 数值 默认 5毫秒）
	 * @param arg2第二个参数（bool :
	 *            Boolean值 标识是否循环 true:是，false:否 ，默认为 false）
	 */
	this.show2 = function(DocumentObject, genre, speed, bool) {
		var le = parseInt(this.getStyle(DocumentObject, 'left'));
		var tp = parseInt(this.getStyle(DocumentObject, 'top'));
		var wh = parseInt(this.getStyle(DocumentObject, 'width'));
		var ht = parseInt(this.getStyle(DocumentObject, 'height'));
		var hnum = 100, hint = 0;
		function spread() {
			if (hnum > 4) {
				hint = hint + 1;
				hnum = hnum - speed;
				DocumentObject.style.left = (le + hint * speed) + "px";
				DocumentObject.style.top = (tp + hint * speed) + "px";
				if(user_browser == 'ie'){
					DocumentObject.style.filter = "alpha(opacity=" + hnum + ")";
				}
				DocumentObject.style.opacity = (hnum/100);
				DocumentObject.style.MozOpacity = (hnum/100);
				setTimeout(spread, 1);
			} else {
				DocumentObject.style.left = le + "px";
				DocumentObject.style.top = tp + "px";
				if(user_browser == 'ie'){
					DocumentObject.style.filter = "alpha(opacity=100)";
				}
				DocumentObject.style.opacity = 1;
				DocumentObject.style.MozOpacity = 1;
				DocumentObject.style.display = "none";
				if (bool) {
					shrink();
				}
			}
		}

		var b_i = 200, b_w = wh + 200, b_h = ht + 200;
		function shrink() {
			DocumentObject.style.display = 'block';
			b_i -= 10;
			b_w -= speed;
			b_h -= speed;
			DocumentObject.style.width = b_w + 'px';
			DocumentObject.style.height = b_h + 'px';
			DocumentObject.style.left = (le + wh / 2 - b_w / 2) + 'px';
			DocumentObject.style.top = (tp + ht / 2 - b_h / 2) + 'px';
			if(user_browser == 'ie'){
				DocumentObject.style.filter = 'alpha(opacity="' + (100 - b_i)
					+ '")';
			}
			DocumentObject.style.opacity = ((100-b_i)/100);
			DocumentObject.style.MozOpacity = ((100-b_i)/100);
			if (b_w > wh || b_h < ht) {
				setTimeout(shrink, 10);
			} else {
				DocumentObject.style.width = wh + 'px';
				DocumentObject.style.height = ht + 'px';
				DocumentObject.style.left = le + 'px';
				DocumentObject.style.top = tp + 'px';
				if (bool) {
					spread();
				}
			}
		}

		if (genre == 'spread') {
			spread();
		} else if (genre == 'shrink') {
			shrink();
		}
	};
	/**
	 * @author Yisin
	 * @date 2011-10-26
	 * @version 1.0
	 * @param arg1
	 *            第一个参数（speed ：动画速度 数值 默认 5毫秒）
	 * @param arg2
	 *            第二个参数（bool : Boolean值 标识是否循环 true:是，false:否 ，默认为 false）
	 */
	this.show3 = function() {
		var DocumentObject = this.Y();
		var speed = arguments[0];
		var bool = arguments[1];
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (speed == undefined || typeof (speed) != 'number') {
			speed = this.speed;
		}
		if (bool == undefined || typeof (bool) != 'boolean') {
			bool = this.bool;
		}
		var le = parseInt(DocumentObject.style.left);
		var tp = parseInt(DocumentObject.style.top);
		var wh = parseInt(DocumentObject.style.width);
		var ht = parseInt(DocumentObject.style.height);
		var dv = document.createElement("div");
		dv.setAttribute("id", "sdiv" + Math.random * 10);
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		obody.appendChild(dv);
		dv.style.position = 'absolute';
		dv.style.zIndex = '1';
		dv.style.width = wh + 'px';
		dv.style.height = ht + 'px';
		dv.style.left = le + 'px';
		dv.style.top = tp + 'px';
		dv.style.backgroundColor = DocumentObject.style.backgroundColor;
		dv.style.border = DocumentObject.style.border;
		this.show2(dv, speed, bool);
	};
	/**
	 * @author Yisin
	 * @date 2011-10-26
	 * @version 1.0
	 * @description 控制Document元素自由移动
	 * @param arg1
	 *            第一个参数（DocumentObject : Div，Table， 对象） 此参数必须存在
	 * @param arg2
	 *            第二个参数（speed ：动画速度 数值 默认 5毫秒）
	 */
	this.drift = function() {
		var DocumentObject = arguments[0];
		var speed = arguments[1];
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (speed == undefined || typeof (speed) != 'number') {
			speed = this.speed;
		}
		var sp1 = speed;
		var sp2 = speed;
		var width = parseInt(DocumentObject.style.width);
		var height = parseInt(DocumentObject.style.height);
		var left = parseInt(DocumentObject.style.left);
		var top = parseInt(DocumentObject.style.top);
		if (width == undefined || typeof (width) != 'number') {
			width = 0;
		}
		if (height == undefined || typeof (height) != 'number') {
			height = 0;
		}
		if (left == undefined || typeof (left) != 'number') {
			left = 0;
		}
		if (top == undefined || typeof (top) != 'number') {
			top = 0;
		}
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		var cwid = parseInt(obody.clientWidth);
		var chei = parseInt(obody.clientHeight);
		function moves() {
			left = left + sp1;
			top = top + sp2;
			DocumentObject.style.left = left + 'px';
			DocumentObject.style.top = top + 'px';
			if (left > (cwid - width)) {
				if (speed > 0) {
					sp1 = -speed;
				} else {
					sp1 = speed;
				}
			}
			if (left < 0) {
				if (speed > 0) {
					sp1 = speed;
				} else {
					sp1 = -speed;
				}
			}
			if (top > (chei - height)) {
				if (speed > 0) {
					sp2 = -speed;
				} else {
					sp2 = speed;
				}
			}
			if (top < 0) {
				if (speed > 0) {
					sp2 = speed;
				} else {
					sp2 = -speed;
				}
			}
			setTimeout(moves, 1);
		}

		moves();
	};
	/**
	 * @author Yisin
	 * @date 2011-10-26
	 * @description 控制Document元素向外扩散
	 * @param arg1
	 *            第一个参数（DocumentObject : Div，Table， 对象） 此参数必须存在
	 * @param arg2
	 *            第二个参数（speed ：动画速度 数值 默认 5毫秒）
	 */
	this.diffusion = function() {
		var DocumentObject = arguments[0];
		var speed = arguments[1];
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (speed == undefined || typeof (speed) != 'number') {
			speed = this.speed;
		}
		var i = 0;
		var le = parseInt(DocumentObject.style.left);
		var tp = parseInt(DocumentObject.style.top);
		var wh = parseInt(DocumentObject.style.width);
		var ht = parseInt(DocumentObject.style.height);
		var w = wh, h = ht;
		function start() {
			i += speed;
			w += speed;
			h += speed;
			DocumentObject.style.width = w + 'px';
			DocumentObject.style.height = h + 'px';
			DocumentObject.style.left = (le + wh / 2 - w / 2) + 'px';
			DocumentObject.style.top = (tp + ht / 2 - h / 2) + 'px';
			if(user_browser == 'ie'){
				DocumentObject.style.filter = 'alpha(opacity="' + (100 - i) + '")';
			}
			DocumentObject.style.opacity = ((100-i)/100);
			DocumentObject.style.MozOpacity = ((100-i)/100);
			if (w < wh * 3 || h < ht * 3) {
				setTimeout(start, 10);
			} else {
				DocumentObject.style.display = 'none';
			}
		}

		start();
	};
	/**
	 * @author Yisin
	 * @date 2011-10-26
	 * @version 1.0
	 * @description document 元素拖动 使用方法： 方法使用在 onmousedown 事件上 <div id="ddd2"
	 *              style="width:300px;height:200px;background-color:#ffffff;"
	 *              onmousedown="J(this).drag(event,true)"> <input type="text"
	 *              name=""><br>
	 *              <br>
	 *              <br>
	 *              </div> onmousedown="J(this).drag(event,true)” 或者
	 *              onmousedown="J('#ddd2').drag()"
	 * @param arg1
	 *            第一个参数（event ：document 事件对象）可以不填写
	 * @param arg2
	 *            第二个参数（alphaBool ：boolean值，标识是否透明化，可以不填写 ，默认为false）
	 */
	this.drag = function(event, bool) {
		var DocumentObject = this.Y();
		var event = arguments[0];
		var alphaBool = arguments[1];
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (event == undefined || typeof (event) != 'event') {
			event = window.event;
		}
		if (alphaBool == undefined || typeof (alphaBool) != 'boolean') {
			alphaBool = this.bool;
		}
		// x,y 对象左边距，上边距（左上角坐标）
		var position = this.getPosition(DocumentObject);
		var x = parseInt(position['left']);
		var y = parseInt(position['top']);
		var w = parseInt(DocumentObject.style.width);
		var h = parseInt(DocumentObject.style.height);
		// body 宽度、高度
		var obody = CheckBrowser()[0] == 'ie' || CheckBrowser()[0] == 'ff' ? document.body: document.documentElement;
		var screenWidth = parseInt(obody.clientWidth);
		var screenHeight = parseInt(obody.clientHeight);
		// 鼠标点击的位置离对象左上角坐标点的差
		var deltaX = event.clientX - x;
		var deltaY = event.clientY - y;
		//
		if (document.addEventListener) {
			document.addEventListener("mousemove", moveHandler, true);
			document.addEventListener("mouseup", upHandler, true);
		} else {
			document.attachEvent("onmousemove", moveHandler);
			document.attachEvent("onmouseup", upHandler);
		}
		//
		if (event.stopPropagation) {
			event.stopPropagation();
		} else {
			event.cancelBubble = true;
		}
		if (event.preventDefault) {
			event.preventDefault();
		} else {
			event.returnValue = false;
		}
		// 透明
		if (alphaBool) {
			if(user_browser == 'ie'){
				DocumentObject.style.filter = 'alpha(opacity=30)';
			}
			DocumentObject.style.opacity = 0.3;
			DocumentObject.style.MozOpacity = 0.3;
		}
		// 拖动
		function moveHandler(e) {
			if (!e) {
				e = window.event;
			}
			var xox = (e.clientX - deltaX);
			var yoy = (e.clientY - deltaY);
			if(xox < 0 || yoy < 0 || (xox > (screenWidth - w - 5)) || (yoy > (screenHeight - h - 5))){
				return;
			}
			DocumentObject.style.left = xox + "px";
			DocumentObject.style.top = yoy + "px";
			//
			if (event.stopPropagation) {
				event.stopPropagation();
			} else {
				event.cancelBubble = true;
			}
		}

		// 松开鼠标
		function upHandler(e) {
			if (document.removeEventListener) {
				document.removeEventListener("mouseup", upHandler, true);
				document.removeEventListener("mousemove", moveHandler, true);
			} else {
				document.detachEvent("onmouseup", upHandler);
				document.detachEvent("onmousemove", moveHandler);
			}
			//
			if (event.stopPropagation) {
				event.stopPropagation();
			} else {
				event.cancelBubble = true;
			}
			// 恢复透明度
			if (alphaBool) {
				if(user_browser == 'ie'){
					DocumentObject.style.filter = 'alpha(opacity=100)';
				}
				DocumentObject.style.opacity = 1;
				DocumentObject.style.MozOpacity = 1;
			}
		}

	};
	/**
	 * @author Yisin
	 * @date 2011-11-08
	 * @version 1.0
	 * @scription 弹出遮罩层 使用方法： <input type="button" value="增加"
	 *            onclick="J('#addDiv').cover('show','shrink')"> <div
	 *            id="addDiv"> <input type="text" name="name"><br>
	 *            <input type="text" name="age"><br>
	 *            <input type="button" button="关闭"
	 *            onclick="J('#addDiv').cover('hidden','hidden')"> < /div> 参数说明：
	 * @param genre : 类型（show:显示/hidden:隐藏）默认是show -----可以为空
	 * @param cartoonGenre ： 动画（显示动画[show/shrink] | 隐藏动画[hidden/spread]）--可以为空
	 * @param text : 标题文本--可以为空
	 * @param owidth : 宽度--可以为空
	 * @param oheight : 高度--可以为空
	 * @param oleft : 左边距--可以为空
	 * @param otop : 右边距--可以为空
	 * @param needClose : 是否需要关闭按钮，默认为true--可以为空
	 * @param isReusable : 是否可重用（默认为true，false:每次都新创建）--可以为空
	 * @param needBanner : 是否需要banner (默认为true)--可以为空
	 * @param isDrag : 是否可以拖动 (默认为true)--可以为空
	 * @param isAlpha : 是否需要半透明背景 (默认为true)--可以为空
	 * @param isRemove : 是否移除层 (默认为true)--可以为空
	 * @param fullScreen : 是否需要全屏 (默认为true)--可以为空
	 * @param needWait : 是否需要显示等待 (默认为true)--可以为空
	 * @param autoScreen : 是否自动全屏 (默认为false)--可以为空
	 * @param closeFunc : 关闭窗口时的回调函数--可以为空
	 */
	this.cover = function() {
		var DocumentObject = this.Y();
		var arg0 = arguments[0];
		var args = typeof(arg0) == 'object' && arguments.length == 1;
		var genre = args ? arg0.genre : arguments[0];
		var cartoonGenre = args ? arg0.cartoonGenre : arguments[1];
		var text = args ? arg0.text : arguments[2];
		var owidth = args ? arg0.owidth : arguments[3];
		var oheight = args ? arg0.oheight : arguments[4];
		var oleft = args ? arg0.oleft : arguments[5];
		var otop = args ? arg0.otop : arguments[6];
		var needClose = args ? arg0.needClose : arguments[7];
		var isReusable = args ? arg0.isReusable : arguments[8];
		var needBanner = args ? arg0.needBanner : arguments[9];
		var isDrag = args ? arg0.isDrag : arguments[10];
		var isAlpha = args ? arg0.isAlpha : arguments[11];
		var isRemove = args ? arg0.isRemove : arguments[12];
		var fullScreen = args ? arg0.fullScreen : arguments[13];
		var needWait = args ? arg0.needWait : arguments[14];
		var autoScreen = args ? arg0.autoScreen : arguments[15];
		var closeFunc = args ? arg0.closeFunc : arguments[16];
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (genre == undefined || typeof (genre) != 'string') {
			genre = 'show';
		}
		if (text == undefined || typeof (text) != 'string') {
			text = '提示';
		}
		if (needClose == undefined || typeof (needClose) != 'boolean') {
			needClose = true;
		}
		if (isReusable == undefined || typeof (isReusable) != 'boolean') {
			//isReusable = true;
			isReusable = false;
		}
		if (needBanner == undefined || typeof (needBanner) != 'boolean') {
			needBanner = true;
		}
		if (isDrag == undefined || typeof (isDrag) != 'boolean') {
			isDrag = true;
		}
		if (isAlpha == undefined || typeof (isAlpha) != 'boolean') {
			isAlpha = true;
		}
		if (isRemove == undefined || typeof (isRemove) != 'boolean') {
			isRemove = true;
		}
		if (fullScreen == undefined || typeof (fullScreen) != 'boolean') {
			fullScreen = true;
		}
		if (autoScreen == undefined || typeof (autoScreen) != 'boolean') {
			autoScreen = false;
		}
		if (needWait == undefined || typeof (needWait) != 'boolean') {
			needWait = true;
		}
		// 显示
		if (genre == 'show') {
			if(needWait){
				showWait(1);
			}
			// 将显示层居中
			var obody = user_browser == 'ie' ? document.body: document.documentElement;
			var screenWidth = parseInt(obody.clientWidth, 10);
			var screenHeight = parseInt(document.body.clientHeight, 10);
			var myWidth = 550;
			var myHeight = 350;
			if(owidth != undefined && typeof (owidth) == 'number'){
				myWidth = owidth;
			}
			if(oheight != undefined && typeof (oheight) == 'number'){
				myHeight = oheight;
			}
			if(myWidth == undefined || myWidth == 0 || myWidth == '0px'){
				myWidth = screenWidth - 2;
			}
			if(myHeight == undefined || myHeight == 0 || myHeight == '0px'){
				myHeight = screenHeight - 2 - 27;
			}
			/*if((myWidth < 520 && myHeight > 320) || (myWidth/myHeight < 1.3 && myWidth < 600)){
				myWidth = 550;
				myHeight = 350;
			}*/
			if(myWidth > (screenWidth - 2)){
				myWidth = screenWidth - 2;
				oleft = 0;
			}
			if(myHeight > (screenHeight - 2)){
				myHeight = screenHeight - 2 - 27;
				otop = 0;
			}
			cover__width = myWidth;
			cover__height = myHeight;
			DocumentObject.style.width = myWidth + 'px';
			DocumentObject.style.height = myHeight + 'px';
			if (oleft == undefined || typeof (oleft) != 'number') {
				oleft = Math.ceil(screenWidth / 2) - Math.ceil(parseInt(myWidth) / 2) - 1;
			}
			if (otop == undefined || typeof (otop) != 'number') {
				if(needBanner){
					otop = Math.ceil(screenHeight / 2) - Math.ceil(parseInt(myHeight) / 2) - 1 - (27 / 2);
				} else {
					otop = Math.ceil(screenHeight / 2) - Math.ceil(parseInt(myHeight) / 2) - 1;
				}
			}
			cover__left = oleft;
			cover__top = otop;
			DocumentObject.style.display = 'block';
			cover_mark = true;
			if(!isReusable && yisin_headDiv != null){
				try {
					if(isRemove){
						obody.removeChild(yisin_headDiv);
					}
					yisin_headDiv = null;
				} catch (e) {}				
			}
			// 增加头部
			if (yisin_headDiv === null) {
				var id = DocumentObject.id + "_cover";
				yisin_headDiv = document.createElement("div");
				yisin_headDiv.setAttribute("id", id);
				yisin_headDiv.setAttribute("class", 'ui-widget-content');
				yisin_headDiv.className = 'ui-widget-content';
				var obody = user_browser === 'ie' ? document.body: document.documentElement;
				obody.appendChild(yisin_headDiv);
				yisin_headDiv.style.position = 'absolute';
				//yisin_headDiv.style.display = 'none';
				//this.setAlpha(yisin_headDiv, 0);
				yisin_headDiv.style.zIndex = '3000';
				yisin_headDiv.style.width = Math.ceil(parseInt(myWidth))+ 'px';
				if(needBanner){
					yisin_headDiv.style.height = Math.ceil(parseInt(myHeight) + 27) + 'px';
				} else {
					yisin_headDiv.style.height = Math.ceil(parseInt(myHeight)) + 'px';
				}
				yisin_headDiv.style.left = oleft + 'px';
				yisin_headDiv.style.top = otop + 'px';
				yisin_headDiv.style.padding = '1px';
				yisin_headDiv.style.background = 'url('+sname+'images/blank_alpha.png) repeat';
				//yisin_headDiv.style.backgroundColor = '#A9CAFC';021531
				yisin_headDiv.style.border = '1px solid #cccccc';
				// 头部横条
				if(needBanner){
					var heads = document.createElement("div");
					heads.setAttribute("id", "head" + DocumentObject.id);
					heads.style.background = '#6890AF';
					heads.style.width = Math.ceil(parseInt(myWidth))+ 'px';
					/*heads.setAttribute("style", "width:" + myWidth+"px;height:20px;"
							+"border-bottom:2px outset #454565;background:url('"+imgPath+"bjt.gif')");*/					
					// 标题 + onmousedown="J(\'#'+id+'\').drag(event,true)"				
					var titleDivHtml = '<table width="100%" height="25" cellpadding="0" border="0" cellspacing="0"';
					if(isDrag){
						titleDivHtml += ' onmousedown="J(\'#'+id+'\').drag(event,false)" style="cursor:move;"';
					}
					titleDivHtml += '><tr style="font-size:13px;">';
					var ions = '';
					if(window['currentFuncIcon'] != undefined && window['currentFuncIcon'] != ''){
						ions = '<img src="' + currentFuncIcon + '" width="16" height="16" border="0"/>&nbsp;';
					}
					titleDivHtml += '<td id="'+DocumentObject.id+'-cover-td" width="'+Math.ceil(parseInt(myWidth)-45)+'" nowrap="nowrap" style="color:#ffffff">&nbsp;'+ions+text+'</td>';
					titleDivHtml += '<td align="center" nowrap="nowrap">';
					titleDivHtml += '<img id="maximg_'+DocumentObject.id+'" src="'+sname+'images/img/maximize.png" onclick="javascript:J(\'#'+DocumentObject.id+'\').fullScreenCover(this, \''+needBanner+'\');" width="14" height="14" style="cursor:pointer;visibility:'+(fullScreen?'show':'hidden')+'" title="全屏"/>&nbsp;';
					if(needClose){
						titleDivHtml += '<img width="14" height="14" style="cursor:pointer;" src="'+imgPath+'cross-script.png" title="点击关闭窗口,Close the window !" onmouseover="closeIcons(this,1)"';
						titleDivHtml += ' onmouseout="closeIcons(this,2)" onclick="javascript:J(\'#'+DocumentObject.id+'\').cover(\'hidden\');">';
					}
					titleDivHtml += '</td></tr></table>';
					heads.innerHTML = titleDivHtml;
					yisin_headDiv.appendChild(heads);
				}
				yisin_headDiv.appendChild(DocumentObject);
			}
			// 动画spread、show
			if (cartoonGenre != undefined) {
				if (cartoonGenre == 'shrink') {
					this.show2(yisin_headDiv, cartoonGenre, 10);
				} else if (cartoonGenre == 'show') {
					this.show1(yisin_headDiv, cartoonGenre, 10);
				} else {
					yisin_headDiv.style.display = 'block';
					if(needWait){
						setTimeout(function(){
							//yisin.setAlpha(yisin_headDiv, 1);
							hiddenWait('yisin_blankScreen');
						}, 400);
					}
				}
			} else {
				yisin_headDiv.style.display = 'block';
				if(needWait){
					setTimeout(function(){
						//yisin.setAlpha(yisin_headDiv, 1);
						hiddenWait('yisin_blankScreen');
					}, 400);
				}				
			}

			// 隐藏下拉框
			this.selectCtl("", "none");
			// 创建黑屏DIV
			if (yisin_blankScreen == null) {
				if(isAlpha){
					yisin_blankScreen = document.createElement("div");
					yisin_blankScreen.setAttribute("id", "hei" + DocumentObject.id);
					var obody = user_browser == 'ie' ? document.body: document.documentElement;
					obody.appendChild(yisin_blankScreen);
					yisin_blankScreen.style.position = 'absolute';
					yisin_blankScreen.style.zIndex = 1000;
					yisin_blankScreen.style.width = parseInt(obody.offsetWidth,10) + 'px';
					yisin_blankScreen.style.height = obody.scrollHeight == undefined || obody.scrollHeight == '' ? '100%':obody.scrollHeight;
					yisin_blankScreen.style.left = '0px';
					yisin_blankScreen.style.top = '0px';
					yisin_blankScreen.style.background = 'url('+sname+'images/blank_alpha.png) repeat';
					/**yisin_blankScreen.style.backgroundColor = '#263C57';
					if(user_browser == 'ie'){
						yisin_blankScreen.style.filter = 'alpha(opacity=40)';
					}
					yisin_blankScreen.style.opacity = 0.4;
					yisin_blankScreen.style.MozOpacity = 0.4;**/
				}
			} else {
				if(isAlpha){
					yisin_blankScreen.style.display = 'block';
				}
			}
			//
			if(autoScreen){
				this.fullScreenCover(Y('#maximg_'+DocumentObject.id), needBanner);
			}
			// 绑定事件
			$('#'+DocumentObject.id+'_closeimg').click(function(e){
				J('#'+DocumentObject.id).cover('hidden');
				if(needClose && closeFunc != undefined && closeFunc != null){
					closeFunc.call(window, e, DocumentObject.id);
				}
			});
		} else if (genre == 'hidden') {// 隐藏
			var isclose = true;
			if(cartoonGenre == 'alert'){
				if(!window.confirm("您确认要关闭当前窗口吗？")){
					isclose = false;
				}
			}
			if(isclose){
				cover_mark = false;
				// 动画spread、show
				if (cartoonGenre != undefined) {
					if (cartoonGenre == 'spread') {
						this.show2(yisin_headDiv, cartoonGenre, 10);
					} else if (cartoonGenre == 'hidden') {
						this.show1(yisin_headDiv, cartoonGenre, 10);
					} else {
						yisin_headDiv.style.display = 'none';
					}
				} else {
					yisin_headDiv.style.display = 'none';
				}
				if (yisin_blankScreen != null && yisin_blankScreen != undefined) {
					yisin_blankScreen.style.display = 'none';
					var obody = user_browser == 'ie' ? document.body: document.documentElement;
					obody.removeChild(yisin_blankScreen);
					yisin_blankScreen = null;
				}
				this.selectCtl("", "block");
			}
		}
	};
	
	this.fullScreenCover = function(img, nb){
		try {
			var DocumentObject = this.Y();
			if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
				DocumentObject = this.getDocumentObject();
			}
			// 将显示层居中
			var obody = user_browser == 'ie' ? document.body: document.documentElement;
			var screenWidth = parseInt(obody.clientWidth, 10);
			var screenHeight = parseInt(obody.clientHeight, 10);
			var myWidth = cover__width, myHeight = cover__height;
			var oleft = cover__left, otop = cover__top;
			if(img.title == '全屏'){
				if(myWidth > (screenWidth - 20) || myHeight > (screenHeight - 30)){
					return;
				}
				myWidth = screenWidth - 8;
				myHeight = screenHeight - 8 - 27;
				img.src = sname + 'images/img/restore.png';
				img.title = '还原';
				$('#head' + DocumentObject.id + ' table').css('cursor', 'default');
			} else {
				img.src = sname + 'images/img/maximize.png';
				img.title = '全屏';
				$('#head' + DocumentObject.id + ' table').css('cursor', 'move');
			}
			DocumentObject.style.width = myWidth;
			DocumentObject.style.height = myHeight;		

			oleft = Math.ceil(screenWidth / 2) - Math.ceil(parseInt(myWidth) / 2) - 4;
			if(nb || nb == 'true'){
				otop = Math.ceil(screenHeight / 2) - Math.ceil(parseInt(myHeight) / 2) - 2 - (27 / 2);
			} else {
				otop = Math.ceil(screenHeight / 2) - Math.ceil(parseInt(myHeight) / 2) - 2;
			}
			
			if(oleft + myWidth + 2 > screenWidth){
				oleft = 0;
			}
			if(otop + myHeight + 27 > screenHeight){
				otop = 0;
			}

			// 增加头部
			if (yisin_headDiv != null) {				
				yisin_headDiv.style.width = Math.ceil(parseInt(myWidth))+ 'px';
				Y('#head' + DocumentObject.id).style.width = Math.ceil(parseInt(myWidth))+ 'px';
				Y('#'+DocumentObject.id+'-cover-td').style.width = Math.ceil(parseInt(myWidth) - 40)+ 'px';
				if(nb || nb == 'true'){
					yisin_headDiv.style.height = Math.ceil(parseInt(myHeight) + 27) + 'px';
				} else {
					yisin_headDiv.style.height = Math.ceil(parseInt(myHeight)) + 'px';
				}
				yisin_headDiv.style.left = oleft + 'px';
				yisin_headDiv.style.top = otop + 'px';			
			}
			
		} catch (e) {
		}
	};
	
	/**
	 * 控制select显示、隐藏
	 * @param pam id、name、className、tag
	 * @param genre 显示/隐藏(block/none)
	 */
	this.selectCtl = function(pam, genre){
		if (pam != undefined && typeof (pam) == 'string') {
			if (pam.length > 1) {
				var firstChar = pam.substring(0, 1);
				var chars = pam.substring(1, pam.length);
				if (firstChar == '#') {
					this.Y(pam).style.display = genre;
				} else {
					this.setSelect(pam, genre);
				}
			} else {
				this.setSelect('select', genre);
			}
		} else {
			this.setSelect('select', genre);
		}
	};
	
	this.setSelect = function(pam, genre){
		var selectList = this.Y(pam);
		if(selectList != null && selectList != undefined){
			for ( var i = 0; i < selectList.length; i++) {
				var select = selectList[i];
				if(select != null && select != undefined){
					select.style.display = genre;
				}
			}
		}
	};
	
	this.setAlpha = function(obj, alp){
		if(user_browser == 'ie'){
			obj.style.filter = 'alpha(opacity='+(alp*100)+')';
		}
		obj.style.opacity = alp;
		obj.style.MozOpacity = alp;
	};
	
	/**
	 * 气泡提示
	 */
	this.bubble = function() {
		var DocumentObject = this.Y();
		var conStr = arguments[0];
		var title = arguments[1];
		var iTimeCount = arguments[2];
		var fn = arguments[3];
		var buWid = 200, buHig = 100;
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (conStr == undefined || typeof (conStr) != 'string') {
			conStr = 'show';
		}
		if (title == undefined || typeof (title) != 'string') {
			title = '提示';
		}
		if (iTimeCount == undefined || typeof (iTimeCount) != 'number') {
			iTimeCount = 2;
		}
		if(getLength(conStr) > 200 && getLength(conStr) <= 500){
			buWid = 250;
			buHig = 130;
		} else if(getLength(conStr) > 500 && getLength(conStr) <= 1000){
			buWid = 310;
			buHig = 170;
		} else if(getLength(conStr) > 1000 && getLength(conStr) <= 2000){
			buWid = 370;
			buHig = 210;
		} else if(getLength(conStr) > 2000 && getLength(conStr) <= 5000){
			buWid = 430;
			buHig = 240;
		} else if(getLength(conStr) > 5000){
			buWid = 490;
			buHig = 280;
		}
		var position = this.getPosition(DocumentObject);
		var bubbleDiv = document.createElement("div");
		// DocumentObject.focus();
		var hids = "hei" + parseInt(Math.random()*100+1)+'_'+parseInt(Math.random()*100+1);
		bubbleDiv.setAttribute("id", hids);
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		var eve = window.event;
		if(eve == undefined){
			eve = window;
		}
		var mx = eve.clientX;
		var my = eve.clientY;
		var bw = parseInt(obody.clientWidth);
		var bh = parseInt(obody.clientHeight);
		obody.appendChild(bubbleDiv);
		bubbleDiv.style.position = 'absolute';
		bubbleDiv.style.zIndex = 90000;
		bubbleDiv.style.width = buWid + 'px';
		bubbleDiv.style.height = buHig + 'px';
		bubbleDiv.style.backgroundColor = '#dddddd';
		bubbleDiv.style.border = '5px solid #598fcc';
		bubbleDiv.style.display = 'none';
		// bubbleDiv.style.filter = 'alpha(opacity=0)';
		var topDv = document.createElement("div");
		topDv.style.width = buWid + 'px';
		topDv.style.height = '18px';
		topDv.style.paddingTop = '2px';
		topDv.style.backgroundColor = '#94B4EF';
		topDv.style.borderBottom = '1px solid #598fcc';
		topDv.innerHTML = '<table width="100%" border="0" cellpadding="0"><tr><td align="left">'
				+ '<font size="2"><b>'+title+'</b></font></td><td align="right">'
				+ '<span style="float:right;cursor:pointer;color:red;" onclick="show(Y(\'#'
				+ hids + '\'), 5);">关闭</span></td></tr></table>';
		bubbleDiv.appendChild(topDv);
		var mainDv = document.createElement("div");
		mainDv.style.position = 'relative';
		mainDv.style.width = (buWid - 2) + 'px';
		mainDv.style.height = (buHig - 22) + 'px';
		mainDv.style.fontSize = '12px';
		mainDv.style.padding = '2px';
		mainDv.style.color = '#376F6F';
		mainDv.style.overflow = 'auto';
		mainDv.innerHTML = conStr;
		bubbleDiv.appendChild(mainDv);
		
		var bleft = position['left'];
		if(position['left'] >= bw){
			bleft = mx;
		}
		if(bleft >= (bw - parseInt(bubbleDiv.style.width))){
			bleft = (bw - parseInt(bubbleDiv.style.width) - 13);
		} else if(bleft < 0){
			bleft = 10;
		}
		bleft = isNaN(bleft) ?  Math.ceil((bw - parseInt(bubbleDiv.style.width)) / 2) : bleft;
		bubbleDiv.style.left = bleft + 'px';
		
		var btop = position['top'] - 21;
		if(position['top'] >= bh){
			btop = my;
		}
		if(btop >= bh){
			btop = (bh - 21);
		} else if(btop < (parseInt(bubbleDiv.style.height) + 21)){
			btop = parseInt(bubbleDiv.style.height) + 24;
		}
		btop = isNaN(btop) ?  Math.ceil((bh + parseInt(bubbleDiv.style.height)) / 2) : btop;
		bubbleDiv.style.top = (btop - parseInt(bubbleDiv.style.height)) + 'px';
		
		show(bubbleDiv, '4');
		var timer = 0;
		var inv = window.setInterval(function() {
			if (timer > iTimeCount) {
				timer = 0;
				show(bubbleDiv, '5', true);
				window.clearInterval(inv);
				if(fn != undefined && typeof(fn) == 'function'){
					fn.call(window, null);
				}
			} else {
				timer++;
			}
		}, 1000);
	};
	
	/**
	 * 提示窗口
	 */
	this.tooltip = function() {
		var DocumentObject = this.Y();
		var conStr = arguments[0];
		var title = arguments[1];
		var iTimeCount = arguments[2];
		var fn = arguments[3];
		var buWid = 200, buHig = 100;
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (conStr == undefined || typeof (conStr) != 'string') {
			conStr = 'show';
		}
		if (title == undefined || typeof (title) != 'string') {
			title = '提示';
		}
		if (iTimeCount == undefined || typeof (iTimeCount) != 'number') {
			iTimeCount = 2;
		}
		if(getLength(conStr) > 200 && getLength(conStr) <= 500){
			buWid = 250;
			buHig = 125;
		} else if(getLength(conStr) > 500 && getLength(conStr) <= 1000){
			buWid = 300;
			buHig = 150;
		} else if(getLength(conStr) > 1000 && getLength(conStr) <= 2000){
			buWid = 350;
			buHig = 175;
		} else if(getLength(conStr) > 2000 && getLength(conStr) <= 5000){
			buWid = 400;
			buHig = 200;
		} else if(getLength(conStr) > 5000){
			buWid = 450;
			buHig = 225;
		}
		var position = this.getPosition(DocumentObject);
		var bubbleDiv = document.createElement("div");
		// DocumentObject.focus();
		var hids = "hei" + parseInt(Math.random()*100+1)+'_'+parseInt(Math.random()*100+1);
		bubbleDiv.setAttribute("id", hids);
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		var eve = window.event;
		if(eve == undefined){
			eve = window;
		}
		var mx = eve.clientX;
		var my = eve.clientY;
		var bw = parseInt(obody.clientWidth);
		var bh = parseInt(obody.clientHeight);
		obody.appendChild(bubbleDiv);
		bubbleDiv.style.position = 'absolute';
		bubbleDiv.style.zIndex = 90000;
		bubbleDiv.style.width = buWid + 'px';
		bubbleDiv.style.height = buHig + 'px';
		bubbleDiv.style.backgroundColor = '#ffffff';
		bubbleDiv.style.border = '4px solid #E7F0FE';
		bubbleDiv.style.display = 'none';
		// bubbleDiv.style.filter = 'alpha(opacity=0)';
		var topDv = document.createElement("div");
		topDv.style.width = buWid + 'px';
		topDv.style.height = '18px';
		topDv.style.paddingTop = '2px';
		topDv.style.backgroundColor = '#A9CAFC';
		topDv.style.borderBottom = '1px solid #598fcc';
		topDv.innerHTML = '<table width="100%" border="0" cellpadding="0"><tr><td align="left">'
				+ '<font size="2"><b> '+title+'</b></font></td></tr></table>';
		bubbleDiv.appendChild(topDv);
		var mainDv = document.createElement("div");
		mainDv.style.position = 'relative';
		mainDv.style.width = (buWid - 2) + 'px';
		mainDv.style.height = (buHig - 22) + 'px';
		mainDv.style.fontSize = '12px';
		mainDv.style.padding = '2px';
		mainDv.style.color = '#376F6F';
		mainDv.style.overflow = 'auto';
		mainDv.innerHTML = conStr;
		bubbleDiv.appendChild(mainDv);
		
		var bleft = position['left'];
		if(position['left'] >= bw){
			bleft = mx;
		}
		if(bleft >= (bw - parseInt(bubbleDiv.style.width))){
			bleft = (bw - parseInt(bubbleDiv.style.width) - 13);
		} else if(bleft < 0){
			bleft = 10;
		}
		bleft = isNaN(bleft) ?  Math.ceil((bw - parseInt(bubbleDiv.style.width)) / 2) : bleft;
		bubbleDiv.style.left = bleft + 'px';
		
		var btop = position['top'] - 21;
		if(position['top'] >= bh){
			btop = my;
		}
		if(btop >= bh){
			btop = (bh - 21);
		} else if(btop < (parseInt(bubbleDiv.style.height) + 21)){
			btop = parseInt(bubbleDiv.style.height) + 24;
		}
		btop = isNaN(btop) ?  Math.ceil((bh + parseInt(bubbleDiv.style.height)) / 2) : btop;
		bubbleDiv.style.top = (btop - parseInt(bubbleDiv.style.height)) + 'px';
		
		show(bubbleDiv, '4');
		var timer = 0;
		var inv = window.setInterval(function() {
			if (timer > iTimeCount) {
				timer = 0;
				show(bubbleDiv, '5', true);
				window.clearInterval(inv);
				if(fn != undefined && typeof(fn) == 'function'){
					fn.call(window, null);
				}
			} else {
				timer++;
			}
		}, 1000);
	};
	
	/**
	 * 悬浮式自定义小窗口
	 */
	this.popupbox = function() {
		var DocumentObject = this.Y();
		var conStr = arguments[0];
		var title = arguments[1];
		var iTimeCount = arguments[2];
		var flag = arguments[3];
		var buWid = 200, buHig = 100;
		if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
			DocumentObject = this.getDocumentObject();
		}
		if (conStr == undefined || typeof (conStr) != 'string') {
			conStr = '';
		}
		if (title == undefined || typeof (title) != 'string') {
			title = '提示';
		}
		if (iTimeCount == undefined || typeof (iTimeCount) != 'number') {
			iTimeCount = 2;
		}
		if (flag == undefined || typeof (flag) != 'number') {
			flag = 1;
		}
		if(getLength(conStr) > 100 && getLength(conStr) <= 200){
			buWid = 250;
			buHig = 125;
		} else if(getLength(conStr) > 200 && getLength(conStr) <= 800){
			buWid = 300;
			buHig = 150;
		} else if(getLength(conStr) > 800 && getLength(conStr) <= 2000){
			buWid = 350;
			buHig = 175;
		} else if(getLength(conStr) > 2000 && getLength(conStr) <= 5000){
			buWid = 400;
			buHig = 200;
		} else if(getLength(conStr) > 5000){
			buWid = 450;
			buHig = 225;
		}
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		
		var hids = "popupbox_div";
		var popupbox = Y('#popupbox_div');
		if(popupbox != undefined && popupbox != null && popupbox != 'undefined'){
			obody.removeChild(popupbox);
		}
		var bubbleDiv = document.createElement("div");
		bubbleDiv.setAttribute("id", hids);
		var eve = window.event;
		if(eve == undefined){
			eve = window;
		}
		var mx = eve.clientX;
		var my = eve.clientY;
		var bw = parseInt(obody.clientWidth);
		var bh = parseInt(obody.clientHeight);
		obody.appendChild(bubbleDiv);
		bubbleDiv.style.position = 'absolute';
		bubbleDiv.style.zIndex = '90000';
		bubbleDiv.style.width = buWid + 'px';
		bubbleDiv.style.height = buHig + 'px';
		bubbleDiv.style.backgroundColor = '#dddddd';
		bubbleDiv.style.border = '5px solid #598fcc';
		bubbleDiv.style.display = 'none';
		// bubbleDiv.style.filter = 'alpha(opacity=0)';
		var topDv = document.createElement("div");
		topDv.style.width = buWid + 'px';
		topDv.style.height = '18px';
		topDv.style.backgroundColor = '#94B4EF';
		topDv.style.borderBottom = '1px solid #598fcc';
		topDv.innerHTML = '<table width="100%" border="0" cellpadding="0"><tr><td align="left">'
				+ '<font size="2"><b>'+title+'</b></font></td><td align="right"><span style="cursor:hand;color:blue;" onclick="J(document).copyCode(\''+conStr+'\');">复制</span>&nbsp;|&nbsp;<span style="cursor:hand;color:red;" onclick="show(Y(\'#'
				+ hids + '\'), 5);">关闭</span></td></tr></table>';
		bubbleDiv.appendChild(topDv);
		var mainDv = document.createElement("div");
		mainDv.style.position = 'relative';
		mainDv.style.width = (buWid - 2) + 'px';
		mainDv.style.height = (buHig - 22) + 'px';
		mainDv.style.fontSize = '12px';
		mainDv.style.padding = '2px';
		mainDv.style.color = '#376F6F';
		mainDv.style.overflow = 'auto';
		mainDv.innerHTML = conStr;
		bubbleDiv.appendChild(mainDv);
		J(mainDv).bindEvent('click', function(){
			if (user_browser == 'ie') {
			    // for IE
			    var r = document.body.createTextRange();
			    r.moveToElementText(mainDv);
			    r.moveEnd("character"); 
			    r.select();
			} else {
			    // For others
			    var s = window.getSelection();
			    var r = document.createRange();
			    r.selectNode(mainDv);
			    s.addRange(r);
			}
		});

		if(flag == 1 && mx != undefined){
			bleft = mx;
		} else {
			bleft = (bw - parseInt(bubbleDiv.style.width)) / 2;
		}
		if(bleft >= (bw - parseInt(bubbleDiv.style.width) - 10)){
			bleft = (bw - parseInt(bubbleDiv.style.width) - 12);
		} else if(bleft < 0){
			bleft = 10;
		}
		bubbleDiv.style.left = bleft + 'px';
		
		if(flag == 1 && my != undefined){
			btop = my;
		} else {
			btop = (bh - parseInt(bubbleDiv.style.height)) / 2;
		}
		if(btop >= bh){
			btop = (bh - 21);
		} else if(btop < (parseInt(bubbleDiv.style.height) + 21)){
			btop = parseInt(bubbleDiv.style.height) + 21;
		}
		bubbleDiv.style.top = (btop - parseInt(bubbleDiv.style.height)) + 'px';
		
		show(bubbleDiv, '4');
		var timer = 0;
		var inv = window.setInterval(function() {
			if (timer > iTimeCount) {
				timer = 0;
				show(bubbleDiv, '5', true);
				window.clearInterval(inv);
			} else {
				timer++;
			}
		}, 1000);
	};
	
	
	/**
	 * 取得控件的绝对位置
	 */
	this.getPosition = function(obj) {
		obj = obj == undefined ? this.Y() : obj;
		var t = obj.offsetTop;
		var l = obj.offsetLeft;
		while (obj = obj.offsetParent) {
			t += obj.offsetTop;
			l += obj.offsetLeft;
		}
		
		var xl = 0, yt = 0;
		if(typeof window.pageYOffset != 'undefined') {
			xl = window.pageXOffset;
			yt = window.pageYOffset;
		}
		  // 如果浏览器支持 compatMode, 并且指定了 DOCTYPE, 通过 documentElement 获取滚动距离作为页面和视窗间的距离
		  // IE 中, 当页面指定 DOCTYPE, compatMode 的值是 CSS1Compat, 否则 compatMode 的值是 BackCompat
		else if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
			xl = document.documentElement.scrollLeft;
			yt = document.documentElement.scrollTop;
		}
		  // 如果浏览器支持 document.body, 可以通过 document.body 来获取滚动高度，如果是在ifram里面，用document.body可以获取iframe中滚动条的位置。
		else if(typeof document.body != 'undefined') {
			xl = document.body.scrollLeft;
			yt = document.body.scrollTop;
		}
		l = (l-xl); 
		t = (t-yt);		
		var pam = {
			left : +l,
			top : +t
		};
		return pam;
	};
	
	this.getMousePoint = function (){
        var point = {x:0,y:0};
        // 如果浏览器支持 pageYOffset, 通过 pageXOffset 和 pageYOffset 获取页面和视窗之间的距离
        if(typeof window.pageYOffset != 'undefined') {
            point.x = window.pageXOffset;
            point.y = window.pageYOffset;
        }
        // 如果浏览器支持 compatMode, 并且指定了 DOCTYPE, 通过 documentElement 获取滚动距离作为页面和视窗间的距离
        // IE 中, 当页面指定 DOCTYPE, compatMode 的值是 CSS1Compat, 否则 compatMode 的值是 BackCompat
        else if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
            point.x = document.documentElement.scrollLeft;
            point.y = document.documentElement.scrollTop;
        }
        // 如果浏览器支持 document.body, 可以通过 document.body 来获取滚动高度，如果是在ifram里面，用document.body可以获取iframe中滚动条的位置。

        else if(typeof document.body != 'undefined') {
            point.x = document.body.scrollLeft;
            point.y = document.body.scrollTop;
        }
        // 加上鼠标在视窗中的位置
        var event=window.event?window.event:evt;
        point.x += event.clientX;
        point.y += event.clientY;
        
        // 返回鼠标在视窗中的位置
        return point;
     };

	this.createPage = function(n, currentPageIndex, totalPageCount, pageCount,
			allDataSize) {
		var hobj = this.Y();
		if (hobj == undefined || hobj == null) {
			alert('缺少对象！');
			return;
		}
		if(currentPageIndex > totalPageCount){
			currentPageIndex = totalPageCount;
			if(currentPageIndex == 0){
				currentPageIndex = 1;
			}
			window['currentPageIndex'+n] = currentPageIndex;
			window['fromIndex'+n] = (currentPageIndex - 1) * window['dataCount'+n];
			window['toIndex'+n] = currentPageIndex * window['dataCount'+n];
			if(totalPageCount > 0){
				var keyword = Y('#keyword');
				if(keyword != undefined && keyword.value != ''){
					search();
				} else {
					advanced();
				}
				return;
			}
		}
		var pageHtmls = "";
		var sIndex = 1;
		var dIndex = 20;
		var middle = parseInt(pageCount / 2);
		if (totalPageCount > pageCount) {
			if ((currentPageIndex - middle) >= 1) {
				sIndex = (currentPageIndex - middle);
				if ((sIndex + pageCount - 1) <= totalPageCount) {
					dIndex = (sIndex + pageCount - 1);
				} else {
					sIndex = (totalPageCount - pageCount + 1);
					dIndex = totalPageCount;
				}
			} else {
				sIndex = 1;
				dIndex = (sIndex + pageCount - 1) <= totalPageCount ? (sIndex
						+ pageCount - 1) : totalPageCount;
			}
		} else {
			sIndex = 1;
			dIndex = totalPageCount;
		}
		pageHtmls = '<table border="0" cellpadding="0" height="18"><tr><td nowrap="nowrap">';
		// 如果不存在数据则不显示上一页、跳转到首页
		if(allDataSize > 0){
			var pnarr = [10, 15, 20, 30, 50, 100];
			pageHtmls += '<div style="display:inline-block;*display:inline;zoom:1;border:1px solid #95cdfa;padding:0px;">';
			pageHtmls += '<div style="width:65px;display:inline-block; *display:inline; zoom:1.04; height:16px; overflow:hidden; position:relative;">';
			pageHtmls += '<select style="width:68px;border:1px solid #ccc; height:21px; font-size:11px; position:relative; zoom:1; margin:-2px;" onchange="showCount' + n
							+ '(this.value)" title="当前每页显示'+window['dataCount'+n]+'条记录">';
			for (var i =0;i<pnarr.length;i++) {
				if (pnarr[i] == window['dataCount'+n]) {
					pageHtmls += '<option value="'+pnarr[i]+'" title="每页显示'+pnarr[i]+'条记录" selected>'+pnarr[i]+'条/页</option>';
				} else {
					pageHtmls += '<option value="'+pnarr[i]+'" title="每页显示'+pnarr[i]+'条记录">'+pnarr[i]+'条/页</option>';
				}
			}
			pageHtmls += '</select></div></div></td><td nowrap="nowrap">';
			
			if (currentPageIndex > 1) {
				if(fenye_type == 0){
					pageHtmls += '<span class="pagens" title="跳转到首页"><a href="javascript:inPage'+ n + '(1);">&lt;&lt;</a></span>';
					pageHtmls += '<span class="pagens" title="上一页"><a href="javascript:uPage'	+ n + '();">&lt;</a></span></td><td nowrap="nowrap">';
				} else if(fenye_type == 1){
					pageHtmls += '<button class="pagebutton" style="height:18px;width:30px;" title="跳转到首页" onclick="inPage'+ n + '(1)">首页</button>';
					pageHtmls += '</td><td nowrap="nowrap"><button class="pagebutton" style="height:18px;width:40px;" title="上一页" onclick="uPage'	+ n + '()">上一页</button>';
				}
			} else {
				if(fenye_type == 0){
					pageHtmls += '<span class="pageno" title="跳转到首页">&lt;&lt;</span>';
					pageHtmls += '<span class="pageno" title="上一页">&lt;</span></td><td nowrap="nowrap">';
				} else if(fenye_type == 1){
					pageHtmls += '<button class="pagebutton" style="height:18px;width:30px;" title="跳转到首页" disabled>首页</button>';
					pageHtmls += '</td><td nowrap="nowrap"><button class="pagebutton" style="height:18px;width:40px;" title="上一页" disabled>上一页</button>';
				}
			}
		}
		/** 2013-03-19 修改分页标签只显示当前页 ***/
		if(fenye_type == 0){
			for ( var i = sIndex; i <= dIndex; i++) {
				if (i == currentPageIndex) {
					pageHtmls += '<span class="pageindex" title="当前第'+i+'页">' + i + '</span>';
				} else {
					pageHtmls += '<span class="pagenumber" title="显示第'+i+'页" onclick="inPage' + n
							+ '(' + i + ')">' + i + '</span>';
				}
			}
		}
		
		// 如果不存在数据则不显示下一页、跳转到尾页
		if(allDataSize > 0){
			if (currentPageIndex < totalPageCount) {
				if(fenye_type == 0){
					pageHtmls += '</td><td nowrap="nowrap"><span class="pagens" title="下一页"><a href="javascript:nPage' + n	+ '();">&gt;</a></span>';
					pageHtmls += '<span class="pagens" title="跳转到尾页"><a href="javascript:inPage' + n + '('+totalPageCount+');">&gt;&gt;</a></span>';
				} else if(fenye_type == 1){
					pageHtmls += '</td><td nowrap="nowrap"><button class="pagebutton" style="height:18px;width:40px;" title="下一页" onclick="nPage' + n	+ '()">下一页</button>';
					pageHtmls += '<button class="pagebutton" style="height:18px;width:30px;" title="跳转到尾页" onclick="inPage' + n + '('+totalPageCount+')">尾页</button>';
				}
			} else {
				if(fenye_type == 0){
					pageHtmls += '</td><td nowrap="nowrap"><span class="pagens" title="下一页">&gt;</span>';
					pageHtmls += '<span class="pagens" title="跳转到尾页">&gt;&gt;</span>';
				} else if(fenye_type == 1){
					pageHtmls += '</td><td nowrap="nowrap"><button class="pagebutton" style="height:18px;width:40px;" title="下一页" disabled>下一页</button>';
					pageHtmls += '<button class="pagebutton" style="height:18px;width:30px;" title="跳转到尾页" disabled>尾页</button>';
				}
			}
			var tiputWid = currentPageIndex < 1000 ? '30px': currentPageIndex < 10000 ? '35px' : '40px';
			pageHtmls += '</td><td nowrap="nowrap">&nbsp;<input type="text" id="tiaoInput'+n+'" maxlength="7" style="width:'+tiputWid+';height:18px;margin-top:0px;" value="'+currentPageIndex+'" onblur="tiaoVerify'+n+'(this)"/> ';
			pageHtmls += '</td><td nowrap="nowrap"><button style="height:18px;" title="跳转" id="tiaoButton'+n+'" onclick="tiaoPage'+n+'()">GO</button></td>';
		}
		if(fenye_type == 0){
			pageHtmls += '<td nowrap="nowrap"><span style="float:left;margin-left:3px;">总页码:' + totalPageCount + ', 共:' + allDataSize + '条,  耗时:'+ajax_spendTime+'秒. </span></td></tr></table>';
		} else if(fenye_type == 1){
			pageHtmls += '<td nowrap="nowrap"><span style="float:left;margin-left:3px;">页码:<font color="blue">' + (totalPageCount == 0 ? 0 : currentPageIndex) + '</font>/' + totalPageCount + ', 共:' + allDataSize + '条,  耗时:'+ajax_spendTime+'秒. </span></td></tr></table>';
		}
		hobj.innerHTML = pageHtmls;
	};
	
	// 2012-05-03 增加
	/**
	 * 对select下拉控件的简单操作
	 */
	this.selectValue = function(val){
		var DocumentObject = this.Y();
		var options = DocumentObject.options;
		var size = options.length,opt;
		if(val == undefined || val == null){
			for(var i = 0; i < size; i++){
				opt = options[i];
				if(opt.selected){
					return opt.value;
				}
			}
		}else{
			for(var i = 0; i < size; i++){
				opt = options[i];
				if(opt.value == val){
					opt.selected = true;
				}
			}
		}
	};
	
	/**
	 * 绑定事件
	 * 
	 * @param sEventType
	 *            事件类型
	 * @param fnHandler
	 *            方法体
	 */
	this.bindEvent = function(sEventType,fnHandler){
		var DocumentObject = this.Y();
		// IE和FF的兼容性处理
		if(DocumentObject.addEventListener){// 如果是FF
			DocumentObject.addEventListener(sEventType,fnHandler,false);
		} else if(DocumentObject.attachEvent){// 如果是IE
			DocumentObject.attachEvent('on'+sEventType,fnHandler);
		} else{
			DocumentObject['on'+sEventType] = fnHandler;
		}
	};
	
	this.copyCode = function(value){
		var DocumentObject = this.Y();
		var testCode = value == undefined || value == ''? DocumentObject.value : value;
		if(this.copy2Clipboard(testCode) != false){
			alert("生成的代码已经复制到粘贴板，你可以使用Ctrl+V 贴到需要的地方去了哦！");
		}
	};
	
	this.copy2Clipboard = function(txt){
		if(txt != undefined && txt != null && txt != ''){
			txt = replaceBr(txt);
		}
		if(window.clipboardData){
			window.clipboardData.clearData();
			window.clipboardData.setData("Text", txt);
		} else if(navigator.userAgent.indexOf("Opera") != -1){
			window.location = txt;
		} else if(window.netscape){
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			} catch(e) {
				alert("您的firefox安全限制限制您进行剪贴板操作，请打开’about:config’将signed.applets.codebase_principal_support’设置为true’之后重试，相对路径为firefox根目录/greprefs/all.js");
				return false;
		}
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if(!clip) return;
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if(!trans) return;
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
		var copytext = txt;
		str.data = copytext;
		trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid = Components.interfaces.nsIClipboard;
		if(!clip)return false;
			clip.setData(trans,null,clipid.kGlobalClipboard);
		}
	};
	
	/**
	 * $.ajax的再次封装，请求方式为POST
	 * @param url 请求URL
	 * @param param 请求参数
	 * @param successfn 包含三个参数(data:后台返回数据，jsondata:data格式化为josn格式的数据，other:等同于本函数第5个参数)
	 * @param errorfn 包含四个参数(XMLHttpRequest, textStatus, errorThrown, other:等同于本函数第5个参数) 可为空
	 * @param other 额外参数，可作为successfn与errorfn中的参数使用,可为空
	 * @param isAlpha 额外参数，是否需要透明背景,可为空
	 * @param isAsync ajax操作同步还是异步，false为同步 ,true为异步
	 * @param ishaveWait 是否需要显示等待条，默认为true:需要，false不需要
	 */
	this.ajax = function(ops){
		if(ops == undefined && typeof(ops) != 'object'){
			alert('参数不正确！');
			return;
		}
		var sd = new Date();
		var startTime = sd.getTime();
		var url = ops.url;
		var param = ops.param;
		var successfn = ops.successfn;
		var errorfn = ops.errorfn;
		var other = ops.other;
		var isAlpha = ops.isAlpha;
		var isAsync = ops.isAsync;
		var tips = ops.tips;
		if(param != undefined && param != null && param.length > 2){
			param = param.substring(0,1) == '&' ? param.substring(1) : param;
		}
		if(isAlpha == undefined || isAlpha == null || typeof(isAlpha) != 'boolean'){
			isAlpha = true;
		}
		if(isAsync == undefined || isAsync == null || typeof(isAsync) != 'boolean'){
			isAsync = true;
		}
		showWait(1, '', '', tips, isAlpha);
		$.ajax({
			type : 'POST',
			async:isAsync,
			url  : url,
			data : param,
			success : function(data) {
				var ed = new Date();
				var endTime = ed.getTime();
				ajax_spendTime = (endTime - startTime) / 1000;
				hiddenWait();
				if (data != undefined && data != null && data != '') {
					if(data == 'loginTimeout'){
						alert('登陆已超时，请重新登陆！');
						window.location.href = sname+'forword.jsp';
						return;
					}else if(data == 'noPermissions'){
						alert('您没有此操作权限！');
						return;
					}
					if(successfn != undefined && successfn != null && typeof(successfn) == 'function'){
						var jsondata = data;
						try {
							jsondata = JSON.parse(data);
						} catch (e) {}
						if(other != undefined && other != null){
							successfn.call(window, data, jsondata, other);
						} else {
							successfn.call(window, data, jsondata);
						}
					}
				} else {
					if(errorfn != undefined && errorfn != null && typeof(errorfn) == 'function'){
						if(other != undefined && other != null){
							errorfn.call(window, null, null, null, other);
						} else {
							errorfn.call(window, null, null, null);
						}
					}
				}
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				var ed = new Date();
				var endTime = ed.getTime();
				ajax_spendTime = (endTime - startTime) / 1000;
				hiddenWait();
				if(errorfn != undefined && errorfn != null && typeof(errorfn) == 'function'){
					if(other != undefined && other != null){
						errorfn.call(window, XMLHttpRequest, textStatus, errorThrown, other);
					} else {
						errorfn.call(window, XMLHttpRequest, textStatus, errorThrown);
					}
				}
			}
		});
	};
	
	/**
	 * 添加信息显示
	 * @param gen 类型，1:正确信息，2：警告信息，3：错误信息
	 * @param msg 消息
	 */
	this.addInfo = function(gen, msg){
		var DocumentObject = this.Y();
		if(gen == 1){
			DocumentObject.innerHTML = '<img src="'+sname+'images/tick-circle.png" width="14" height="14"/><font color="#2F8E5F">'+msg+'</font>';
		} else if(gen == 2){
			DocumentObject.innerHTML = '<img src="'+sname+'images/exclamation-octagon.png" width="14" height="14"/><font color="#0000CC">'+msg+'</font>';
		} else if(gen == 3){
			DocumentObject.innerHTML = '<img src="'+sname+'images/cross-circle.png" width="14" height="14"/><font color="#ff0000">'+msg+'</font>';
		}
	};
}

var yisin = new Yisin();

function show(obj, flag, bool) {
	if(obj == undefined || obj == null){
		return;
	}
	var e = window.event;
	var inval = 5, speed = 1, timer = 0, alpha = 0, inv;
	if (flag == '1') {
		var width = y.getStyle(obj, 'width');
		var height = y.getStyle(obj, 'height');
		var left = y.getStyle(obj, 'left');
		var top = y.getStyle(obj, 'top');
		obj.innerHTML = '';
		inv = window.setInterval(function() {
			if (obj.style.width < 0 && obj.style.height < 0) {
				timer = 0;
				obj.style.display = 'none';
				window.clearInterval(inv);
			} else {
				timer++;
				try {
					obj.style.width = (parseInt(width) - timer * inval * 3)
							+ 'px';
					obj.style.height = (parseInt(height) - timer * inval)
							+ 'px';
					obj.style.top = (parseInt(top) - timer * inval) + 'px';
					if(timer > 40){
						timer = 0;
						obj.style.display = 'none';
						window.clearInterval(inv);
					}
				} catch (e) {
					timer = 0;
					obj.style.display = 'none';
					window.clearInterval(inv);
				}
			}
		}, speed);
	}

	if (flag == '2') {
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		inv = window.setInterval(function() {
			if (alpha <= 0) {
				timer = 0;
				obj.style.display = 'none';
				if (bool) {
					obody.removeChild(obj);
				}
				window.clearInterval(inv);
			} else {
				alpha -= 4;
				try {
					if(user_browser == 'ie'){
						obj.style.filter = 'alpha(opacity=' + alpha + ')';
					}
					obj.style.opacity = (alpha/100);
					obj.style.MozOpacity = (alpha/100);
				} catch (e) {
					alpha = 100;
					obj.style.display = 'none';
					if (bool) {
						obody.removeChild(obj);
					}
					window.clearInterval(inv);
				}
			}
		}, speed);
	}

	if (flag == '3') {
		if(user_browser == 'ie'){
			obj.style.filter = 'alpha(opacity=' + alpha + ')';
		}
		obj.style.opacity = (alpha/100);
		obj.style.MozOpacity = (alpha/100);
		obj.style.display = 'block';
		alpha = 0;
		inv = window.setInterval(function() {
			if (alpha >= 100) {
				window.clearInterval(inv);
			} else {
				alpha += 4;
				try {
					if(user_browser == 'ie'){
						obj.style.filter = 'alpha(opacity=' + alpha + ')';
					}
					obj.style.opacity = (alpha/100);
					obj.style.MozOpacity = (alpha/100);
				} catch (e) {
					alpha = 80;
					window.clearInterval(inv);
				}
			}
		}, speed);
	}
	
	if(flag == '4'){
		obj.style.display = 'block';
	}
	
	if(flag == '5'){
		obj.style.display = 'none';
	}

}

/**
 * @author Yisin
 * @date 2011-10-26
 * @version 1.0
 * @param arg1
 *            第一个参数（speed ：动画速度 数值 默认 5毫秒）
 * @param arg2
 *            第二个参数（bool : Boolean值 标识是否循环 true:是，false:否 ，默认为 false）
 * @param arg3
 *            第三个参数（createSpeed : 对象生成速度，默认1000毫秒，受arg3影响，当arg3=false时，arg4失效）
 */
Yisin.prototype.show4 = function() {
	var DocumentObject = this.Y();
	var speed = arguments[0];
	var bool = arguments[1];
	var createTime = arguments[2];
	if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
		DocumentObject = this.getDocumentObject();
	}
	if (speed == undefined || typeof (speed) != 'number') {
		speed = this.speed;
	}
	if (bool == undefined || typeof (bool) != 'boolean') {
		bool = this.bool;
	}
	if (createTime == undefined || typeof (createTime) != 'number') {
		createTime = 1000;
	}
	var le = parseInt(DocumentObject.style.left);
	var tp = parseInt(DocumentObject.style.top);
	var wh = parseInt(DocumentObject.style.width);
	var ht = parseInt(DocumentObject.style.height);
	function create() {
		var dv = document.createElement("div");
		dv.setAttribute("id", "dv" + DocumentObject.id);
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		obody.appendChild(dv);
		dv.style.position = 'absolute';
		dv.style.zIndex = '1';
		dv.style.width = wh + 'px';
		dv.style.height = ht + 'px';
		dv.style.left = le + 'px';
		dv.style.top = tp + 'px';
		dv.style.backgroundColor = DocumentObject.style.backgroundColor;
		dv.style.border = DocumentObject.style.border;
		new Yisin().drift(dv, speed);
		if (bool) {
			setTimeout(create, parseInt(1000 / createTime));
		}
	}

	create();
};
/**
 * @author Yisin
 * @date 2011-10-26
 * @version 1.0
 * @param arg1
 *            第一个参数（speed ：动画速度 数值 默认 5毫秒）
 * @param arg2
 *            第二个参数（count : Number值 数量 幻影数量 默认：10个）
 * @param arg3
 *            第三个参数（createSpeed : 对象生成速度，默认10毫秒，）
 * @param arg4
 *            第四个参数（bool : Boolean值 标识DocumentObject最后是否消失 true:是，false:否 ，默认为
 *            false）
 */
Yisin.prototype.show5 = function() {
	var DocumentObject = this.Y();
	var speed = arguments[0];
	var count = arguments[1];
	var createTime = arguments[2];
	var bool = arguments[3];
	if (DocumentObject == undefined || typeof (DocumentObject) != 'object') {
		DocumentObject = this.getDocumentObject();
	}
	if (speed == undefined || typeof (speed) != 'number') {
		speed = this.speed;
	}
	if (count == undefined || typeof (count) != 'number') {
		count = 10;
	}
	if (bool == undefined || typeof (bool) != 'boolean') {
		bool = this.bool;
	}
	if (createTime == undefined || typeof (createTime) != 'number') {
		createTime = 10;
	}
	var le = parseInt(DocumentObject.style.left);
	var tp = parseInt(DocumentObject.style.top);
	var wh = parseInt(DocumentObject.style.width);
	var ht = parseInt(DocumentObject.style.height);
	var dn = 0;
	function create() {
		var dv = document.createElement("div");
		dv.setAttribute("id", "dv" + DocumentObject.id);
		var obody = user_browser == 'ie' ? document.body: document.documentElement;
		obody.appendChild(dv);
		dv.style.position = 'absolute';
		dv.style.zIndex = '1';
		dv.style.width = wh + 'px';
		dv.style.height = ht + 'px';
		dv.style.left = le + 'px';
		dv.style.top = tp + 'px';
		dv.style.backgroundColor = DocumentObject.style.backgroundColor;
		dv.style.border = DocumentObject.style.border;
		dn++;
		if (dn < (count - 1)) {
			new Yisin().diffusion(dv, speed);
			setTimeout(create, parseInt(1000 / createTime));
		} else {
			new Yisin().diffusion(dv, speed);
			if (bool) {
				new Yisin().diffusion(DocumentObject, speed);
			}
		}
	}

	create();
};

Yisin.prototype.data = new Array();

/**
 * @author Yisin
 * @date 2011-11-08
 * @version 1.0
 * @scription 获取到document对象 参数说明：
 * @param pam
 *            id,name,class,tagName 如果用id名作为参数 则在 前面加上 # 例如 Y('#userName')
 * 如果用name名作为参数 则在 前面加上 @ 例如 Y('@password') 如果用class名作为参数 则在 前面加上 . 例如 Y('.ins')
 *            如果用tagName名作为参数 则前面不加任何字符 例如 Y('table');Y('div')
 * 
 */
function Y(pam) {
	if (pam != undefined || typeof (pam) == 'string') {
		if (pam.length > 1) {
			var firstChar = pam.substring(0, 1);
			var chars = pam.substring(1, pam.length);
			if (firstChar == '#') {
				return document.getElementById(chars);
			} else if (firstChar == '@') {
				return document.getElementsByName(chars);
			} else if (firstChar == '.') {
				return getElementsByClassName(chars);
			} else {
				return document.getElementsByTagName(pam);
			}
		} else {
			return document.getElementsByTagName(pam);
		}
	} else if (pam != undefined && typeof (pam) == 'object') {
		return pam;
	}
};

/**
 * @author Yisin
 * @description 根据ClassName获取document对象
 * @param className
 *            class样式名称
 */
function getElementsByClassName(className) {
	var all = document.all ? document.all : document.getElementsByTagName('*');
	var elements = new Array();
	for ( var i = 0; i < all.length; i++) {
		if (all[i].className == className) {
			elements[elements.length] = all[i];
		}
	}
	return elements;
}

/**
 * @author Yisin
 * @date 2011-11-08
 * @version 1.0
 * @scription 文本框输入内容验证 
 * @使用方法： 
 * 		方法一 ：< input type="text" name="username" onblur="checks(this,'chinese','请输入中文！')"><br/>
 * 		方法二 ：< input type="text" name="password" onblur="checks(this,/^\w+$/,'密码不支持中文！','true')">
 * @参数说明：obj : 网页Document对象 验证本身就填写this,如要触发验证其他文本框可以用 Y() 方法来获取到对象作为参数 <br/>
 *            exc : 正则表达式或类型 可以直接自定义 /^$/ 作为参数 ，也可以填写固定的类型如下： <br/>
 *            ------'email' ：/^[a-zA-Z0-9]{4,16}@[a-zA-Z0-9]{2,8}.[com|cn|net|org]{2,3}$/;<br/>
 *            ------'phone' : /^(13|15)[0-9ssssssssss][0-9]{8}$/; <br/>
 *            ------'plane' : /^0[1-9]{2,3}-[0-9]{7,8}$/; <br/>
 *            ------'chinese' : /^[\u4e00-\u9fa5]*$/;<br/>
 *            ------'non_chinese' : /^\w+$/; <br/>
 *            ------'number' : /^[0-9]*$/; <br/>
 *            ------'char' : /^[a-zA-Z]*$/; <br/>
 *            info : 提示信息 例如：'请输入中文.' <br/>
 *            notNull : 标识是否可以为空 true:不能为空/false:可以为空 ，不填写默认可以为空!<br/>
 */
function checks(obj, exc, info, notNull) {
	var value = obj.value;
	if (notNull == undefined || typeof (notNull) != 'boolean') {
		notNull = false;
	}
	if (typeof (exc) != "object" && typeof (exc) == "string") {
		if (exc == 'email') {// 匹配邮箱
			exc = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		} else if (exc == 'phone') {// 匹配手机
			exc = /^(13|15|18)[0-9][0-9]{8}$/;
		} else if (exc == 'plane') {// 匹配座机
			exc = /^0[1-9]{2,3}-[0-9]{7,8}$/;
		} else if (exc == 'chinese') {// 匹配只能输入中文
			exc = /^[\u4e00-\u9fa5]*$/;
		} else if (exc == 'non_chinese') {// 匹配由数字、26个英文字母或者下划线组成的字符串
			exc = /^\w+$/;
		} else if (exc == 'number') {// 匹配全数字
			exc = /^[\-]{0,1}[0-9]*$/;
		} else if (exc == 'mixstring') {// 数字、26个英文字母混合字符
			exc = /^([0-9]+[a-zA-Z]+[0-9a-zA-Z]*|[a-zA-Z]+[0-9a-zA-Z]*)+$/;
		} else if (exc == 'word') {// 匹配26个英文字母
			exc = /^[a-zA-Z]*$/;
		} else if (exc == 'english') {// 匹配英文单词，可包含空格
			exc = /^[a-zA-Z][a-zA-Z\s]*$/;
		} else if (exc == 'floats') {// 匹配整数与小数
			exc = /^([\-]{0,1}0.[0-9]*|[\-]{0,1}[1-9][0-9]*\.[0-9]*|[\-]{0,1}[0-9]*)$/;
		} else if (exc == 'chars') {// 匹配正常字符（由中文、数字、26个英文字母、下划线等组成）
			exc = /^[\u4e00-\u9fa50-9a-zA-Z_\s]*$/;
		} else if (exc == 'sign') {// 匹配特殊符（包含& % < > 等符号）
			exc = /^(&|%|<|'|"|\*)*$/;
		} else if (exc == 'non_char') {// 匹配网页显示不正常字符（包含& < ' "等符号）
			// exc = /^(&|>)*$/;
		} else if (exc == 'carnumber') {// 匹配车牌号（例如粤B 74110）
			exc = /^[\u4e00-\u9fa50-9a-zA-Z-]{4,9}$/;
		} else if (exc == 'space') {// 匹配一个或多个空格
			exc = /^[\s]+$/;
		} else if(exc == 'ipv4'){ // 匹配IP V4地址
			exc = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
		} else if(exc == 'ipv6'){ // 匹配IP V6地址
			exc = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
		} else if(exc == 'postcode'){ // 匹配邮政编码
			exc = /^[1-9][0-9]{5}$/;
		} else if(exc == 'fax'){ // 匹配传真机号码
			exc = /^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
		} else if(exc == 'required'){ // 不能为空
			exc = /^[^\s]+$/;
		}
		// 可继续扩展
	}
	if (value != undefined && value.length > 0) {
		if (exc == 'non_char') {
			return !checkDesc(obj);
		}
		if (!exc.test(value)) {
			if (info != undefined) {
				alert(info);
			} 
			return false;
			obj.focus();
		} else {
			return true;
		}
	} else {
		if (notNull) {
			alert("此项不能为空！");
			obj.focus();
			return false;
		}else{
			return true;
		}
	}
}

/**
 * 检查备注字段 不能包含特殊字符
 * 
 * @param obj
 *            对象
 * @param arr
 *            数组，可省略，例子：['<','&',''','"','%']
 * @returns {Boolean}
 */
function checkDesc(obj, arr){
	var value = obj.value;
	var chars = value.split('');
	if(arr == undefined || typeof(arr) != 'object'){
		arr = ['<','&',"'",'"','%'];
	}
	for(var i=0;i<chars.length;i++){
		var cha = chars[i];
		for(var j=0;j<arr.length;j++){
			if(cha == arr[j]){
				return false;
			}
		}
	}
	return true;
}

/**
 * 获取文本字节长度，包含双字节
 * 
 * @param sString
 * @returns
 */
function getLength(sString){
	var sStr, iCount, i, strTemp;
	iCount = 0;
	sStr = sString.split("");
	for (i = 0; i < sStr.length; i++) {
		strTemp = escape(sStr[i]);
		if (strTemp.indexOf("%u", 0) == -1) {
			iCount = iCount + 1;
		} else if(strTemp == '%0D%0A' && i < (sStr.length - 1)){
			iCount = iCount + 3;
		} else {
			iCount = iCount + 2;
		}
	}
	return iCount;
}

function subStr(sString, size){
	var showStr = '';
	var exc = /^[\u4e00-\u9fa5]*$/;// 中文
	var sStr = sString.split("");
	var index = 0, iCount = 0;
	for (i = 0; i < sStr.length; i++) {
		if (exc.test(sStr[i])) {
			iCount += 2;
		} else {
			iCount += 2;
		}
		if(iCount > size){
			index = i;
			break;
		}
	}
	showStr = sString.substring(0, index);
	return showStr;
}

/**
 * 计算文字长度。
 * 
 * @param1 要计算的文本框ID，< input id="xxxx"/>----必需
 * @param2 要限制的文字长度，数值----必需
 * @param3 提示剩余几个字符串的span的id，<span id="zzzzz">
 */
function checkContentLength(id, size, tit) {
	var sString = Y('#'+id).value;
	var iCount = getLength(sString);
	if(iCount > size){
		J('#'+id).bubble('您输入的文字长度已超过限制('+size+'字母或'+size/2+'个汉字)，请酌情删减！');
		return false;
	} else {
		if(tit != undefined){
			Y('#'+tit).innerHTML = '您大约还能输入'+(size - iCount - 2)+'个字符.';
		}
	}
	return true;
}   


/**
 * 计算文字长度。
 * 
 * @param1 要计算的文本框ID，< input id="xxxx"/>----必需
 * @param2 要限制的文字长度，数值----必需
 * @param3 提示剩余几个字符串的span的id，<span id="zzzzz">
 */
function checkContentLength2(id, size,tit) {
	var sString = Y('#'+id).value;
	var iCount = getLength(sString);
	if(iCount > size){
		var msg='';
		if(tit != undefined&& tit!=''){
			msg=tit+'中的文字长度已超过限制('+size+'字母,数字或'+size/2+'个汉字)，请酌情删减！';
		}else{
			msg='您输入的文字长度已超过限制('+size+'字母,数字或'+size/2+'个汉字)，请酌情删减！';
		}
		J('#'+id).bubble(msg);
		return false;
	} else {		
		return true;
	}
}  

/**
 * 检查浮点数长度是否合法
 */
function checkFloatLength(id,alllength,decimalslength,msg){
	var name=$('#'+id).val();
	var s= name.split('.');
	var intleng=alllength-decimalslength;
	var allleng=alllength+1;
	// alert(allleng);
	if(s[0].length>intleng){
		   J('#'+id).bubble(msg+'整数不能超过'+intleng+'位数！');
			return false;
	   }else if(null!=s[1]&&s[1].length>2){
		   J('#'+id).bubble('小数不能超过'+decimalslength+'位！');
			return false;
	   }else if(name.length>allleng){
		   J('#'+id).bubble(msg+'总位数不能超过'+allleng+'位数！');
			return false;
	   }else{
		   return true;
	   }
	
}

/**
 * 判断文本是否过长，超过一定长度（默认20：大约10个中文汉字或20个字母/数字）就截取段， 只显示“详细”超链接，点击详细再显示全部。
 * 
 * @param 字符串
 * @param 截取长度，默认20
 */
function createDetail(sString, ss){
	var sString = sString == null || undefined ? '' : sString;
	var showStr = sString;
	try {
		var iCount = getLength(sString);
		var iSize = ss == undefined || typeof(ss) != 'number' ? 20 : ss;
		if(iCount > iSize){
			var d = new Date();
			var ids = d.getTime()+''+(Math.random() * 1000);
			showStr = subStr(sString, iSize) 
			+ '<a href="javascript:void(0);" onclick="seekDetail(this)" char="'+sString+'">&nbsp;<img src="'+sname+'images/icons/other/applicationre.png" width="14" height="14" title="查看详细"/></a>';
			showStr = '<span id="sp'+ids+'" title="'+sString+'">' + showStr + '</span>';
			//showStr += '<a href="javascript:void(0);" onclick="J(this).popupbox(\''+sString+'\',\'详细\',20,1)">详细</a>';
		}
	} catch (e) {}	
	return showStr;
}

/**
 * 查看详情
 */
var xqwindow = null;
function seekDetail(t){
	var xqstr = $(t).attr('char');
	var x = (screen.availWidth - 550) / 2;
	var y = (screen.availHeight - 320) / 2;
	if(xqwindow == null || xqwindow.closed){
		xqwindow = window.open('about:blank', 'xqwindow', 'width=500px,height=320px,location=no,status=no,scroll=yes,toolbar=no,menubar=no,left=' + x + ',top='+ y);
	}
	xqwindow.window.document.body.innerHTML = xqstr;
	xqwindow.window.document.body.style.margin = '0px';
	xqwindow.window.document.body.style.padding = '2px';
	xqwindow.window.document.body.style.color = '#000066';
	xqwindow.focus();
}

/**
 * 日期时间，大小比较 dateStr1 < dateStr2 ? true : false;
 * 
 * @param dateStr1
 *            时间字符串
 * @param dateStr2
 *            时间字符串 不填写时默认当前系统时间
 * @param isQuals 是否可以相等
 */
function compareDate(dateStr1, dateStr2, isQuals){
	if(dateStr1 == undefined){
		alert('参数不能为空！');
		return;
	}
	isQuals = isQuals == undefined ? false : isQuals;
	var index = dateStr1.indexOf('.');
	if(index != -1){
		dateStr1 = dateStr1.substring(0,index);
	}
	var date2 = new Date();
	var date1 = new Date(Date.parse(dateStr1.replace(/-/g, "/")));  
	if(dateStr2 != undefined && dateStr2 != ''){
		date2 = new Date(Date.parse(dateStr2.replace(/-/g, "/")));  
	}
	if(isQuals){
		if(date1.getTime() <= date2.getTime()){
			return true;
		} else {
			return false;
		}
	} else {
		if(date1.getTime() < date2.getTime()){
			return true;
		} else {
			return false;
		}
	}
}

/**
 * 处理为空字符串
 * 
 * @param param
 * @param value
 * @returns
 */
function excNull(param, value){
	if(param == null || param == 'null'){
		if(value != null && value != undefined){
			return value;
		} else {
			return "";
		}
	} else {
		return param;
	}
}

/***
 * 
 * 处理浮点型值为0.0的问题
 * 
 */
function excFloat(param,value){
	if(param == 0 || param == 0.0){
		if(value!=null && value != undefined){
			return value;
		}
		return '';
	}else{
		return param;
	}
}


/**
 * 将文本中回车换行符\n替换成<br>
 * 标签
 * 
 * @param param
 */
function replaceEnter(param){
	if(param != undefined && param != null && param != ''){
		while(param.indexOf('\n') != -1){
			param = param.replace('\n','<br>');
		}
	}
	return param;
}

/**
 * 将文本中<br>
 * 标签替换成回车换行符\n
 * 
 * @param param
 */
function replaceBr(param){
	if(param != undefined && param != null && param != ''){
		while(param.indexOf('<br>') != -1 || param.indexOf('<BR>') != -1){
			param = param.replace('<br>','\n');
			param = param.replace('<BR>','\n');
		}
	}
	return param;
}

/**
 * 处理特殊字符：& % < ' "
 * @param param
 */
function excTeshu(param){
	if(param != undefined && param != null && param != ''){
		while(param.indexOf('<') != -1 || param.indexOf('&') != -1 
				|| param.indexOf('%') != -1 || param.indexOf("'") != -1 
				|| param.indexOf('"') != -1){
			param = param.replace('<','#lt;');
			param = param.replace('%','#BFH#');
			param = param.replace('&','#AND#');
			param = param.replace("'",'’');
			param = param.replace('"','”');
		}
	}
	return param;
}

/**
 * 转码，将字符串（汉字）转码
 * @param param
 */
function coding(param){
	if(param != undefined && param != null){
		param = encodeURI(encodeURI(param));
	} 
	return param;
}

function substring(param, fromIndex, toIndex){
	if(param != undefined && param != null){
		fromIndex = fromIndex == undefined || '' || null ? 0 : fromIndex;
		toIndex = toIndex == undefined || '' || null ? param.length : toIndex;
		if(param.length > toIndex){
			param = param.substring(fromIndex, toIndex);
		}
	} 
	return param;
}

// 等待条
var waitDiv = null;
function showWait() {
	var genre = arguments[0];
	var oleft = arguments[1];
	var otop = arguments[2];
	var text = arguments[3];
	var boll = arguments[4];
	if (genre == undefined || typeof (genre) != 'number') {
		genre = 0;
	}
	if (text == undefined || typeof (text) != 'string') {
		text = '数据加载中，请稍等....';
	}
	if (boll == undefined || typeof (boll) != 'boolean') {
		boll = true;
	}
	var obody = user_browser == 'ie' ? document.body: document.documentElement;
	var screenWidth = parseInt(obody.clientWidth);
	var screenHeight = parseInt(obody.clientHeight);
	if (oleft == undefined || typeof (oleft) != 'number') {
		oleft = Math.ceil(screenWidth / 2) - 100;
	}
	if (otop == undefined || typeof (otop) != 'number') {
		otop = Math.ceil(screenHeight / 2) - 50;
	}
	if (waitDiv == null) {
		waitDiv = document.createElement("div");
		waitDiv.setAttribute("id", "wait_Div");
		obody.appendChild(waitDiv);
		waitDiv.style.position = 'absolute';
		waitDiv.style.zIndex = 4000;
		waitDiv.style.left = oleft + 'px';
		waitDiv.style.top = otop + 'px';
		if (genre == 0) {
			var img = document.createElement("img");
			img.setAttribute("src", imgPath + "waiting.gif");
			waitDiv.appendChild(img);
		} else if (genre == 1) {
			waitDiv.style.backgroundImage = 'url(' + imgPath + 'wait-bg.png)';
			waitDiv.style.background = '#E3EFFD';
			waitDiv.style.border = '4px solid #509CF1';
			waitDiv.style.width = '200px';
			waitDiv.style.height = '70px';
			waitDiv.style.fontSize = '12px';
			waitDiv.style.paddingTop = '22px';
			waitDiv.style.paddingLeft = '12px';
			var img = document.createElement("img");
			img.setAttribute("src", imgPath + "waiting-small.gif");
			img.setAttribute("align", "middle");
			img.setAttribute("valign", "absmiddle");
			waitDiv.appendChild(img);
			var tenode = document.createTextNode(' '+text);
			waitDiv.appendChild(tenode);
		}
	} else {
		waitDiv.style.display = 'block';
	}
	if(boll){
		// 创建黑屏DIV
		if (yisin_blankScreen == null) {
			yisin_blankScreen = document.createElement("div");
			yisin_blankScreen.setAttribute("id", "heiundefined");
			obody.appendChild(yisin_blankScreen);
			yisin_blankScreen.style.position = 'absolute';
			yisin_blankScreen.style.zIndex = 3500;
			yisin_blankScreen.style.width = parseInt(obody.offsetWidth,10) + 'px';
			yisin_blankScreen.style.height = obody.scrollHeight == undefined || obody.scrollHeight == '' ? '100%':obody.scrollHeight;
			yisin_blankScreen.style.left = '0px';
			yisin_blankScreen.style.top = '0px';
			yisin_blankScreen.style.background = 'url('+sname+'images/blank_alpha.png) repeat';
			/**yisin_blankScreen.style.backgroundColor = '#ffffff';
			if(user_browser == 'ie'){
				yisin_blankScreen.style.filter = 'alpha(opacity=1)';
			}
			yisin_blankScreen.style.opacity = 0.1;
			yisin_blankScreen.style.MozOpacity = 0.1;**/
		} else {
			yisin_blankScreen.style.display = 'block';
		}
		obody.style.overflow = 'hidden';
	}
}
/**
 * 隐藏等待条
 */
function hiddenWait(hid) {
	var obody = user_browser == 'ie' ? document.body: document.documentElement;
	if (waitDiv != null) {
		waitDiv.style.display = 'none';
		waitDiv = null;
	} else {
		waitDiv = Y('#wait_Div');
		if(waitDiv != undefined){
			waitDiv.style.display = 'none';
			waitDiv = null;
		}
	}
	if(hid != undefined && hid == 'notHiddenBlank'){
		return;
	}
	if(hid == undefined || hid != 'yisin_blankScreen'){
		if(yisin_blankScreen != null){
			yisin_blankScreen.style.display = 'none';
			//yisin_blankScreen = null;
			obody.style.overflow = 'auto';
		}else{
			yisin_blankScreen = Y('#heiundefined');
			if(yisin_blankScreen != undefined){
				yisin_blankScreen.style.display = 'none';
				//yisin_blankScreen = null;
			}
			obody.style.overflow = 'auto';
		}
	} else {
		yisin_blankScreen.style.zIndex = 1000;
	}
}

var myDialog;
function openDialog(urlstr, obj, width, height, attr) {
	var x = (screen.availWidth - width) / 2;
	var y = (screen.availHeight - height) / 2;
	var attrs = 'dialogWidth:' + width + 'px;dialogHeight:' + height
			+ 'px;dialogLeft:' + x + ';dialogTop:' + y;
		attrs += ';location:0;status:no;scroll:yes;toolbar:no;menubar:no;';

	myDialog = window.showModalDialog(urlstr, obj, attrs);
}

var myWindow;
function openWindow(urlstr, width, height) {
	var x = (screen.availWidth - width) / 2;
	var y = (screen.availHeight - height) / 2;
	myWindow = window.open(urlstr, 'myWindow', 'width=' + width + 'px,height='
			+ height + 'px,location=no,status=no,scroll=yes,toolbar=no,menubar=no,left=' + x + ',top='
			+ y);
}
/**
 * @param1 content 内容
 * @param2 width 宽度
 * @param3 height 高度
 * @param4 x X坐标
 * @param5 y Y坐标
 */
function openPopup() {
	var content = arguments[0];
	var width = arguments[1];
	var height = arguments[2];
	var x = arguments[3];
	var y = arguments[4];
	if (window.navigator.appName == "Microsoft Internet Explorer"
			&& window.navigator.appVersion.substring(
					window.navigator.appVersion.indexOf("MSIE") + 5,
					window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5) {
		var popupObj = window.createPopup();
		var popupBodyObj = popupObj.document.body;
		popupBodyObj.style.border = "4px solid #dedede";
		popupBodyObj.innerHTML = content;
		if (x == undefined || x == null) {
			x = screen.width - width;
		}
		if (y == undefined || y == null) {
			y = screen.height - height;
		}
		popupObj.show(x, y, width, height);
	} else {
		alert('只支持IE浏览器，且ie5.5以上版本！');
	}
}

// '+sname+'images/icons/other/calendar-day.png
/**
 * 时间框显示控件
 * 
 * @param genre
 *            类型 ‘date’：日期 、‘time’：日期+时间
 * @param id
 *            文本框id属性名（必须）
 * @param name
 *            文本框name属性名(可为空)
 * @param va
 *            文本框的value值(可为空)
 * 
 */
function createDateInput(genre, id, name, va, fmt, isWriter){
	if(Y('#'+id) != null) {
		alert(id+'重复');
		return;
	}
	var func = fmt == undefined || null ? (genre=='date'? "WdatePicker()":"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"):"WdatePicker({dateFmt:'"+fmt+"'})";
	va = va == undefined || null ? '' : va;
	isWriter = isWriter == undefined || '' ? true : isWriter;
	var html = '<input type="text" value="'+va+'" size="'+(genre =='date'?11:21)+'" id="'+(id==undefined?'':id)+'" name="'+(name==undefined?'':name)+'" readonly class="Wdate" onclick="'+func+'">';
	if(isWriter){
		document.write(html);
	} else{
		return html;
	}
}


/**
 * 两个时间框显示控件
 * 
 * @param genre
 *            类型 ‘date’：日期 、‘time’：日期+时间
 * @param id1
 *            文本框1id属性名（必须）
 * @param name1
 *            文本框1name属性名(可为空)
 * @param va1
 *            文本框1的value值(可为空)
 * @param title1
 *            控件1前缀名称(可为空)
 * @param id2
 *            文本框2id属性名（必须）
 * @param name2
 *            文本框2name属性名(可为空)
 * @param va2
 *            文本框2的value值(可为空)
 * @param title2
 *            控件2前缀名称(可为空)
 * @param fmt
 *            日期时间格式，默认为'yyyy-MM-dd HH:mm:ss'
 * 
 */
function createDateInput2(genre, id1, name1, va1, title1, id2, name2, va2, title2, fmt){
	if(Y('#'+id1) != null) {
		alert(id1+'重复');
		return;
	}
	if(Y('#'+id2) != null) {
		alert(id2+'重复');
		return;
	}
	va1 = va1 == undefined || null ? '' : va1;
	title1 = title1 == undefined || null ? '' : title1;
	
	va2 = va2 == undefined || null ? '' : va2;
	title2 = title2 == undefined || null ? '' : title2;
	var func = fmt == undefined || null ? (genre=='date'? "WdatePicker()":"WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"):"WdatePicker({dateFmt:'"+fmt+"'})";

	var html = '<table cellpadding="0" border="0" cellspacing="0" width="'+(genre=='date'?92:142)+'" height="14" style="float:left;width:'+(genre=='date'?92:142)+'px;height:18px;"><tr>';
	if(title1 != ''){
		html += '<td nowrap="nowrap" style="border:0px;">'+title1+'</td>';		
	}
	html += '<td nowrap="nowrap">';
	html += '<input type="text" value="'+va1+'" size="'+(genre =='date'?11:21)+'" id="'+(id1==undefined?'':id1)+'" name="'+(name1==undefined?'':name1)+'" readonly class="Wdate" onclick="'+func+'">';
	html += '</td>';
		
	if(title2 != ''){
		html += '<td nowrap="nowrap" style="border:0px;">&nbsp;-&nbsp;'+title2+'</td>';		
	}
	html += '<td nowrap="nowrap">';
	html += '<input type="text" value="'+va2+'" size="'+(genre =='date'?11:21)+'" id="'+(id2==undefined?'':id2)+'" name="'+(name2==undefined?'':name2)+'" readonly class="Wdate" onclick="'+func+'">';
	html += '</td>';
	html += '</tr></table>';
	document.write(html);
}

function closeIcons(t, n){
	if(n == 1){
		t.src = sname+'images/cross-circle.png';
	} else if(n == 2){
		t.src = sname+'images/cross-script.png';
	}
}

/***
 * function名称：showAttachPanel
 * 参数说明：
 *@param t  html控件对象
 *@param fName 附件原名称字符串
 *@param fNameSave 附件保存路径字符串
 * 
 */

var copObj = null;
var fileName = '',fileNameSave = '';
function showAttachPanel(t,fName,fNameSave){
	var isShow = $('#attaDiv').css('display');
	if(copObj == t){
		if(isShow == 'none'){
			$('#attaDiv').css('display','block');
			return;
		}else if(isShow == 'block'){
			document.body.removeChild(Y('#attaDiv'));
		}
	}else{
		if(copObj != null){
			document.body.removeChild(Y('#attaDiv'));
		}
	}
	var attaDiv = document.createElement("div");
	attaDiv.setAttribute('id','attaDiv');
	attaDiv.style.width = '200px';
	attaDiv.style.border = '2px solid #021531';
	attaDiv.style.zIndex = '200';
	attaDiv.style.position = 'absolute';
	attaDiv.style.backgroundColor = '#ffffff';
	attaDiv.style.display = 'block';
	document.body.appendChild(attaDiv);
	
	copObj = t;
	fileName = fName;
	fileNameSave = fNameSave;
	var po = J(window).getMousePoint();
	var oleft = po.x;
	var otop = po.y;
	attaDiv.style.left = (oleft - 45) + 'px';
	attaDiv.style.top = (otop + 10) + 'px';
	
	var trStr = null;
	var fileNum = 0;
	if(fileName!=''&&fileNameSave!=''&&fileName!=undefined&&fileNameSave!=undefined){
		var semicolon = fileName.charAt(fileName.length-1);
		if(semicolon == ';'){
			fileName = fileName.substring(0,fileName.length-1);
			fileNameSave =fileNameSave.substring(0,fileNameSave.length-1);
		}
		var fNameArr = fileName.split(';');
		var fNameSave = fileNameSave.split(';');
		fileNum = fNameArr.length;
		trStr ='<div class="divtitle" id="divtitle"><div style="width:170px;float: left;"><img src="'+sname+'images/icons/other/drive-download.png"><font color="#ff0000"><b>附件列表</b></font></div>';
		trStr +='<div id="colseFileDiv" style="float: left;"><img src="'+sname+'images/icons/other/cross-script.png" width="14" height="14" align="middle" ';
		trStr +=' onmouseover="closeDivIco(this,1)" title="点击关闭控件,Close the widget!" onmouseout="closeDivIco(this,2);" style="cursor:hand;" onclick="javascript:$(\'#attaDiv\').css(\'display\', \'none\');"></div></div>';
		trStr += '<div class="fileList" id="fileList" style="overflow:auto;height:'+((20*fileNum)>=180?178:(20*(fileNum+1)))+'px;">';
		for(var i=0;i<fileNum;i++){
			trStr += '<div class="divlipcss"><a href="javascript:void(0);" onclick="downloadFile(\''+fNameSave[i]+'\',\''+fNameArr[i]+'\')" title="'+fNameArr[i]+'"><img src="'+fileTypeIco(fNameArr[i])+'">&nbsp;'+subFileName(fNameArr[i])+'</a></div>';
		}
	}
	
	trStr += '</div>';
	trStr += '<div style="text-align: right;height:20px;background:#B9DCE2;line-height:20px;"><i><b>--附件共 '+fileNum+' 个</b></i></div>';
	attaDiv.innerHTML = trStr;
	addTrsEvents();
}

var div_bg_color;
function addTrsEvents(){
	$(".divlipcss").css("height", "20px");
	$(".divlipcss").css("padding", "3px");
	$(".divlipcss").css("background", "#ffffff");
	$(".divlipcss").css("cursor", "pointer");
	$(".divlipcss:even").css("background", "#eeeeee");
	$('.divtitle').css("height", "25px");
	$(".divtitle").css("padding", "4px");
	$('.divtitle').css("cursor", "move");
	$('.divtitle').css("background", "#B9DCE2");
	
	$(".divlipcss").hover(function() {
		div_bg_color = $(this).css("background-color");
		$(this).css("background", "#ffffcc");
	}, function() {
		$(this).css("background", div_bg_color);
	});
	Y('#divtitle').onmousedown = function(){
		J('#attaDiv').drag(event, false);
	};
}

function subFileName(str){
	var len = getLength(str);
	if(len > 28){
		str = str.substring(0,12) + '...';
	}
	return str;
}

function fileTypeIco(str){
	var src = sname+'images/filetype/unknown.gif';
	var type = '';
	var tieIndex = str.lastIndexOf('.');
	if(tieIndex != -1){
		type = str.substring(tieIndex+1).toLowerCase() ;
	}
	if(type!=''){
		if(type=='aac'||type=='asf'||type=='avi'||type=='dmw'||type=='mp3'||type=='mp4'||
			type=='mpeg'||type=='mpg'||type=='ram'||type=='rm'||type=='rmvb'||type=='wav'||
			 type=='wave'||type=='wm'||type=='wma'||type=='wmv'||type=='amr'||type=='av'||
			  type=='ra'||type=='wmd'||type=='mid'||type=='midi'||type=='ogg'||type=='ogm'||
			   type=='mov'||type=='m3u'){
			src = sname+'images/filetype/avi.gif';
		}else if(type=='bmp'){
			src = sname+'images/filetype/bmp.gif';
		}else if(type=='chm'){
			src = sname+'images/filetype/chm.gif';
		}else if(type=='doc'||type=='docx'){
			src = sname+'images/filetype/doc.gif';
		}else if(type=='exe'||type=='app'){
			src = sname+'images/filetype/exe.gif';
		}else if(type=='gif'){
			src = sname+'images/filetype/gif.gif';
		}else if(type=='htm'||type=='html'||type=='url'){
			src = sname+'images/filetype/htm.gif';
		}else if(type=='iso'||type=='bin'||type=='img'||type=='nrg'){
			src = sname+'images/filetype/iso.gif';
		}else if(type=='ico'){
			src = sname+'images/filetype/ico.gif';
		}else if(type=='jpeg'||type=='jpg'){
			src = sname+'images/filetype/jpeg.gif';
		}else if(type=='pdf'){
			src = sname+'images/filetype/pdf.gif';
		}else if(type=='png'){
			src = sname+'images/filetype/png.gif';
		}else if(type=='ppt'||type=='pptx'){
			src = sname+'images/filetype/ppt.gif';
		}else if(type=='rar'||type=='zip'||type=='tar'||type=='ace'||type=='arj'){
			src = sname+'images/filetype/rar.gif';
		}else if(type=='swf'){
			src = sname+'images/filetype/swf.gif';
		}else if(type=='txt'||type=='sql'){
			src = sname+'images/filetype/txt.gif';
		}else if(type=='wps'){
			src = sname+'images/filetype/wps.gif';
		}else if(type=='xls'||type=='xlsx'){
			src = sname+'images/filetype/xls.gif';
		}else if(type=='xml'){
			src = sname+'images/filetype/xml.gif';
		}else if(type=='ai'){
			src = sname+'images/filetype/ai.gif';
		}else if(type=='ain'){
			src = sname+'images/filetype/ain.gif';
		}else if(type=='asp'||type=='aspx'){
			src = sname+'images/filetype/asp.gif';
		}else if(type=='vsd'){
			src = sname+'images/filetype/vsd.gif';
		}else if(type=='wpt'){
			src = sname+'images/filetype/wpt.gif';
		}
	}
	return src;
}

function closeDivIco(t,id){
	if(id == 1){
		t.src = sname+'images/icons/other/cross-circle.png';
	}else if(id == 2){
		t.src = sname+'images/icons/other/cross-script.png';
	}
}